Modify the SSH remote logon port in Linux

Source: Internet
Author: User
In Linux, modify SSH remote logon port 1, and set the SSH remote logon port to 1211 # vi/etc/ssh/sshd_configPort1211 # Replace & amp; rsquo; # Port22 & amp; rsquo; change to & amp; rsquo; Port1211 & amp; rsquo; # AddressFamilyany # ListenAdd... 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 Add a whitelist to les # iptables-I INPUT-p tcp -- dport 2201-j ACCEPT # service iptables save the first command takes effect immediately, but it will become invalid after restart, therefore, you need to save the command to the iptables configuration file. path:/etc/sysconfig/iptables. 3. add a user with normal permissions and set the password in security enhancement: # useradd xiaozui # Disable ROOT remote logon on the passwd woiit.net server: # vi/etc/ssh/sshd_config # LoginGraceTime2m # PermitRootLoginno # change 'permitrootloginyes' to 'permitrootlogin no' # Region # MaxAuthTries6 # MaxSessions10 # servicesshd re Start # Restart the SSH service. remote management uses xiaozui, a common user, to log on. Then, use suroot to switch to the root user and obtain the highest permission.
 
Related Article

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.