ssh默認端口為22。 通過路由映射,保留一個22端口,其它主機修改端口,可以用一個ip ssh多個主機。
修改端口需修改/etc/ssh/sshd_config
sudo vim /etc/ssh/sshd_config
/Port
#Port 22
刪除前面的#,然后修改端口號,如23
重啟ssh
sudo systemctl restart sshd.service
如果有防火墻需端口放行
sudo ufw allow 23
或
sudo iptables -I INPUT -p tcp --dport 23 -j ACCEPT
測試下端口通不通
nc -vz 192.168.2.61 23
Connection to 192.168.2.61 23 port [tcp/telnet] succeeded!
然后路由上添加端口映射。文章來源:http://www.zghlxwxcb.cn/news/detail-827491.html
ssh user@192.168.2.61 -p 23
ssh 主設備 用默認端口22,其它-p指定端口 ,可以一個ip ssh 多個主機。文章來源地址http://www.zghlxwxcb.cn/news/detail-827491.html
到了這里,關于ssh 修改端口號 一個ip ssh多個主機的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!