[root@localhost ~]# firewall-cmd --zone=public --add-port=11111/tcp --permanent success [root@localhost ~]# firewall-cmd --reload success [root@localhost ~]# more /etc/firewalld/zones/public.xml <?xml version="1.0" encoding="utf-8"?> <zone> <short>Public</short> <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description> <port port="11111" protocol="tcp"/> <forward/> </zone>
1.3 修改sshd的配置
1 2
[root@localhost ~]# cd /etc/ssh/ [root@localhost ssh]# vi sshd_config
[root@localhost ~]# ss -lntp State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 128 0.0.0.0:31234 0.0.0.0:* users:(("sshd",pid=11111,fd=3))