Linux controls sshd Remote Access

Source: Internet
Author: User

Linux controls sshd Remote Access
Test environment: linux centos6.5 1. hosts. allow file configuration: Modify/etc/hosts. allow file # hosts. allow This file describes the names of the hosts which are # allowed to use the local INET services, as decided # by the '/usr/sbin/tcpd' server. # sshd: 210.13.218. *: allowsshd: 222.77.15. *: The preceding allow statement allows two ip segments 210 and 222 to connect to the sshd service. deny files can be used together), of course, ": allow" can be omitted completely. Of course, if the administrator is concentrated on an IP address, it is easy to write all: 218.24.129.110 // he means to accept all requests from the ip address 110! 2. hosts. deny file configuration/etc/hosts. deny file, which is a denial of service list with the following content: # hosts. deny This file describes the names of the hosts which are # * not * allowed to use the local INET services, as decided # by the '/usr/sbin/tcpd' server. # The portmap line is redundant, but it is left to remind you that # the new secure portmap uses hosts. deny and hosts. allow. in particle # you shoshould know that NFS uses portmap! Sshd: all: deny Note: sshd: all: deny indicates that all sshd remote connections are rejected.: Deny can be omitted. Therefore, when hosts. allow conflicts with host. deny, the hosts. allow setting prevails. The modification takes effect immediately. 3. Expansion: 1. prohibit all ip addresses from accessing the linux ssh function in/etc/hosts. add a row named sshd: all: deny 2. prohibit an ip address (192.168.11.112) from accessing the ssh function in/etc/hosts. add a row of sshd: 192.168.11.112 3. in the/etc/hosts. deny and/etc/hosts. allow also has the sshd: 192.168.11.112 rule, then 192.168.11.112 can access the host's ssh service summary: This method can be used to control some unauthorized access, but it is not a permanent method! When we look at service logs, we may see a lot of scan records, instead of directly targeting the root user. controlling your access list is very helpful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.