查看linux的shhd端口號 netstat | grep sshd


[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# netstat | grep sshd

[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# netstat -utpln | grep sshd

tcp        0      0 0.0.0.0:43559               0.0.0.0:*                   LISTEN      1432/sshd           

[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# 

 

[root@iZ2zef51hufoaycipfxek8Z ~]# netstat | grep sshd

[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# netstat -utpln | grep sshd

tcp        0      0 0.0.0.0:43559               0.0.0.0:*                   LISTEN      1432/sshd           

[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# 

[root@iZ2zef51hufoaycipfxek8Z ~]# 

netstat | grep sshd

 

 

 

命令:vi /etc/ssh/sshd_config
找到#Port 22

把前面的#刪掉,在下面再添加一行

Port 5000

命令:/bin/systemctl restart  sshd.service  

重啟服務。

命令:firewall-cmd --zone=public --add-port=5000/tcp --permanent  

把5000端口添加到防火牆

命令:firewall-cmd --reload

重新載入。
試一下連接5000端口,好使的話把22端口刪掉。
---------------------
作者:weixin_35501548
來源:CSDN
原文:https://blog.csdn.net/weixin_35501548/article/details/78720282
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM