写了上一期的教程,还是觉得不要直接把22端口暴露在外面,就来写一篇改端口教程,这一篇有点水,谅解一下。。。
然后你就会发现出现以下东东
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/usr/bin
# 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 override the
# default value.
# 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
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
...
这里Port 22被注释了,光标通过键盘上的箭头移到#,按x删掉前面的#
然后按I,把22改成你想要的端口
然后
保存并退出编辑器
随后
然后在服务器内的防火墙添加放行
云服务器记得放行安全组
完事
李天成 2020/07/04 15:30
转载请注明出处。


叨叨几句... NOTHING