1th step: If you want to restrict access to Linux via SSH IP, you can do the following:
First: Modify/etc/hosts.deny, add Sshd:all in it, and note that you can't add the # number.
Then: Modify:/etc/hosts.allow, in which the following settings are made: sshd:192.168.1.16
This setting only allows 192.168.1.16 IP to log on to the Linux machine via SSH.
Of course, as a server, do not install the GNOME and KDE graphical interface, you can increase the safety factor.
2nd Step: 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 999
Remove the front # number.
And then save the exit
In the terminal input command:/etc/init.d/sshd Restart to restart the SSH service.
This way the SSH port will work concurrently with 22 and 999.
Edit firewall configuration now: Vi/etc/sysconfig/iptables
Enable Port 999.
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 999-j ACCEPT
In the terminal input command:/etc/init.d/iptables Restart to restart the firewall's access rules.
Now, use the SSH tool to connect to port 999 to test for success. If the connection succeeds, edit the Sshd_config settings and the port of the firewall again, remove the Port22 from the inside, and then restart the access rules for the SSH service and firewall.
The first two ports are set, the test is successful and then a port is closed. is to prevent in the process of modifying the 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, so as to avoid the connection must send people to the room, causing problems more complex trouble.