Modify the SSH remote logon port in Linux

Source: Internet
Author: User

In Linux, modify the SSH remote logon Port 1 and the SSH remote logon Port 1211 # vi/etc/ssh/sshd_config Port 1211 # Change '# Port 22' to 'port 1211 '; # AddressFamilyany # ListenAddress0.0.0.0 # ListenAddress: # servicesshd restart # restart the SSH service. 2. Add ports to the firewall. By default, only some ports are enabled in iptables, to use an additional port such as '200', you need to add a whitelist in iptables # iptables-I INPUT-p tcp -- dport 1211-j ACCEPT # service iptables save the First Command takes effect immediately, but it will invalid, therefore, you need to save the command to the iptables configuration file. Path:/etc/sysconfig/iptables. 3. Add security enhancement first. Add a user with normal permissions and set the password: # useradd xiaozui # passwd woiit.net server prohibit ROOT remote login: # vi/etc/ssh/sshd_config # restart # PermitRootLoginno # Change 'permitrootloiny' to 'permitrootlogin no' # modify # MaxAuthTries6 # MaxSessions10 # servicesshd restart # restart the SSH service; remote Management logs on with xiaozui, a common user, and switches to the root user with suroot to obtain the highest permissions.
 

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.