怎样改动ssh的默认设置22号端口号,确保linux服务器远程控制管理方法安全性!
1.登陆服务器,开启sshd_config文档
vim /etc/ssh/sshd_config
2.寻找#Port 22,默认设置是注解掉的,先把前面的#号去掉,再插进1行设定成你要想的端口号号,留意不必跟现有端口号号反复
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
Port 22
Port 23456
3.储存后撤出,实行重新启动指令
/etc/init.d/sshd restart 或 service sshd stop service sshd start
4.新开1个终端设备对话框检测23456端口号是不是能够一切正常联接服务器,假如取得成功则将Port 22删掉,之因此先设定成两个端口号,检测取得成功后再关掉1个端口号,是以便方法在改动conf的全过程中,万1出現掉线、断网、误实际操作等未知状况情况下,还能根据此外1个端口号联接上去调节以防产生联接不上务必派人去主机房,致使难题更为繁杂不便。