修改默认端口
- vi /etc/ssh/sshd_config
默认端口是22,并且已经被注释掉了
Port 22000
- iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 22222 -j ACCEPT
- iptables-save
- 查看端口: iptables -nL --line-number
- 重启sshd: systemctl restart sshd.service
使用非22端口登陆
- ssh -p 22222 hadoop001
来源:oschina
链接:https://my.oschina.net/chinahufei/blog/3217767