Modify Port:
vi /etc/ssh/sshd_config
Find "#Port 22", remove the previous "#", and modify "22" to the port you need, as follows:
# vi /etc/ssh/sshd_config
Port 6123
Save ,quit!
Modify firewall configuration (XenServer virtualization server has firewall settings by default)
vi /etc/sysconfig/iptables
find
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
Modify "--dport 22" to the previously modified port "--dport 6123"
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6123 -j ACCEPT
save and exit , restart the firewall
/etc/init.d/iptables restart
and then restart SSHD
/etc/init.d/sshd restart After
completing the above two steps, you can test the connection, and quickly try to connect.
Note: If you connect to the XenServer server remotely through the ssh client, it is recommended to link 2 Putty (that is, 2 remote sessions) before the operation. Even if the modification is wrong, the recovery operation can be performed through another session.
In addition, the port (XenServer-specific) can also be modified through XenCenter.
Note: Changes to the server-side ssh port have been found in testing to have no effect on XenCenter connections. XenCenter doesn't sense port changes.
XenServer modifies the SSH (22) connection port to improve the security of the server
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326489183&siteId=291194637
Recommended
Ranking