First type:
01 If you want to change the Linux SSH default port (22), then you only have to modify:/etc/ssh/sshd_config Port 22, here 22 into their own to set the port on the line, but do not set and now have the same port, in case of unknown consequences.
02 If you want to limit SSH login IP, you can do the following:
First: Modify/etc/hosts.deny, add Sshd:all in it
Then: Modify:/etc/hosts.allow, in which the following settings are made: sshd:192.168.0.241
This will limit only 192.168.0.241 of IP access to the Linux machine via SSH. Of course, as a server, I do not install GNOME and KDE, and many things are not installed, so as to increase the safety factor.
The second type:
First modify the configuration file
Vi/etc/ssh/sshd_config
Find #port 221, here is the identity default use 22 port, modified to the following:
Port 22
Port 50000
And then save the exit
Perform/etc/init.d/sshd restart
This way the SSH port will work concurrently with 22 and 50000.
Edit firewall configuration now: Vi/etc/sysconfig/iptables
Enable Port 50000.
-A input-m state--state new-m tcp-p TCP--dport 50000-j ACCEPT
Perform/etc/init.d/iptables restart
Now, use the SSH tool to connect to port 50000 to test for success. If the connection succeeds, edit the Sshd_config settings again and delete the Port22 inside.
Set to two ports first, test successful and then shut down a port, is in order to modify the process of Conf, in the event of a drop in the line, broken nets, misoperation and other unknown circumstances, but also through another port connection up to debug to avoid the connection must send people to the room, causing problems more complex trouble.