Modify port 22 in Linux
In Linux, the default SSH port is 22. For security reasons, it is necessary to modify port 22. Now, the port is changed to 60000. The modification method is as follows:
Find Port 22 in/etc/ssh/sshd_config, change it to 60000, or use/usr/sbin/sshd-p 60000 to specify the Port.
[Root @ localhost/] # vi/etc/ssh/sshd_config
Port 60000
[Root @ localhost/] #/usr/sbin/sshd-p 60000
[Root @ localhost/] # service sshd restart
Stop sshd: [OK]
Start sshd [OK]
To enable ports 22 and 60000 at the same time, add the following line in/etc/ssh/sshd_config:
[Root @ localhost/] # vi/etc/ssh/sshd_config
Port 22
Port 60000
Save and exit
[Root @ localhost/] #/etc/init. d/sshd restart
Stop sshd: [OK]
Start sshd [OK]
Test
Xshell: \> ssh root@192.168.1.90
Connecting to 192.168.1.90: 22...
Connection established.
Escape character is ^ @].
Last login: Sun Mar 14 22:44:44 2010 from www-72cbd3ffe95.
[Root @ localhost ~] #
Xshell: \> ssh root@192.168.1.90 60000
Connecting to 192.168.1.90: 60000...
Connection established.
Escape character is ^ @].
Last login: Sun Mar 14 22:47:47 2010 from www-72cbd3ffe95.