今天有两台内网机器需要用到ssh远程登录操作,但是网络策略不通,申请网络策略也被拒绝,原因是不允许申请ssh的常用登录端口。于是灵机一动,直接把ssh监听多个端口,其中一个是非常用端口,然后网络策略申请到这个端口,不就可以了嘛,机制的一批。
cp /etc/ssh/ssh_config /etc/ssh/ssh_config.bak
vim /etc/ssh/ssh_config
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
Port 22
# add by your_name
Port 60901
service sshd restart
netstat -ntlp | grep sshd
如果出现下面这种情况,说明已经OK。
原文:https://www.cnblogs.com/yuxiuyan/p/13591993.html