一、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