linux-doc-修改ssh端口号

打开ssh端口配置

1
vim /etc/ssh/sshd_config

修改配置加上对应端口号

1
2
3
4
5
6
7
8
9
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
Port 51111
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

重启配置

1
2
6.5版本:/etc/init.d/sshd restart
7.4版本:systemctl restart sshd.service

端口修改

端口修改

参考

https://blog.csdn.net/niketwo/article/details/79788843