The first type:
01 If you want to change the default port of the Linux SSH (22), then you just modify:/etc/ssh/sshd_config in Port 22, here to change the 22 to their own port to set the line, but do not set and now have the same port Oh, in case of unknown consequences.
02 If you want to limit the SSH login IP, then you can do the following:
First: Modify the/etc/hosts.deny and add the Sshd:all
Then: Modify:/etc/hosts.allow, in which the following settings: sshd:192.168.0.241
This allows you to 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 a lot of 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 the #port 221 segment, here is the identity by default using 22 port, modified as follows:
Port 22
Port 50000
And then save the exit
Execute/etc/init.d/sshd Restart
This way the SSH port will work with both 22 and 50000.
Now edit the firewall configuration: vi/etc/sysconfig/iptables
Enable Port 50000.
Execute/etc/init.d/iptables Restart
Now, use the SSH tool to connect to port 50000 to test for success. If the connection is successful, edit the Sshd_config settings again and delete the Port22 inside.
Modify the SSH service port