修改/etc/ssh/sshd_config配置文件(注意:这里是sshd_config,而不是ssh_config)

vi /etc/ssh/sshd_config

在sshd_config文件中添加一个端口号2222(这里保留22端口,是为了放置假如配置失败的话,还可以使用22端口使用ssh登录,配置完成后,可以删除22端口)

Port 22
Port 2222

重启 ssh 服务:

systemctl restart sshd.service

 

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2021-05-31
  • 2021-09-27
  • 2022-01-07
  • 2021-10-23
  • 2021-11-12
猜你喜欢
  • 2022-02-07
  • 2022-12-23
  • 2022-02-07
  • 2021-09-06
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案