修改Linux遠程連接的默認22端口


一、SeLinux配置(永久關閉)

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0

二、關閉防火牆(以centos7為例)

systemctl stop firewalld

systemctl disable firewalld

三、確認關閉了selinux和防火牆

修改ssh遠程端口,vim /etc/ssh/sshd_config(按i進入編輯模式,改完后ESC>>shift+:>>wq)

修改后重啟ssh服務,service sshd restart

四、將防火牆重新開啟,systemctl restart firewalld.service

並且授權遠程訪問端口2020,參考https://www.cnblogs.com/54hsh/p/13355413.html


免責聲明!

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



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