[root@v01-svn-test-server ~]# vi /etc/ssh/sshd_config
Port 22
Port 5001
#新增加5001端口给sshd,现在22,5001都是sshd的服务的端口,可以只注销掉22端可(#22)只保留5001端口

 注意一定要重启服务:

[root@v01-svn-test-server ~]# service sshd restart

 

[root@v01-svn-test-server ~]# netstat -lnutp|grep sshd
tcp        0      0 0.0.0.0:5001                0.0.0.0:*                   LISTEN      4492/sshd           
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      4492/sshd           
tcp        0      0 :::5001                     :::*                        LISTEN      4492/sshd           
tcp        0      0 :::22                       :::*                        LISTEN      4492/sshd #可见已经开了 22 和 5001两个端口给sshd服务

 如果不成功看看iptables端口是否打开!!

相关文章:

  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-03-11
  • 2022-02-07
  • 2021-12-15
  • 2021-10-25
  • 2021-06-09
相关资源
相似解决方案