sshd更改默认端口后不起作用
改了/etc/sshd_config里的port后,用systemctl restart sshd、systemctl status sshd发现还是以前的端口,那么是哪里的问题呢?
看了下selinux,getenforce是disabled状态,找了些资料,原来有的centos版本不一样,有的在
vi /usr/local/openssh/etc/sshd_config

里面,在这里改就行了。
修改方法:
vim /usr/local/openssh/etc/sshd_config
Port =8888
修改后退出,看selinux下原来的sshd端口:
semanage port -l | grep ssh
大功告成,重启sshd服务
systemctl restart sshd
本文来自博客园,作者:舒然,转载请注明原文链接:https://www.cnblogs.com/Jeffrey1172417122/p/16149795.html

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号