1.啓動SSH服務
# systemctl start sshd.service
2.隨系統一起啓動服務
# systemctl enable sshd.service
3.開啓防火牆22端口
# iptables -I INPUT -p tcp --dport 22 -j ACCEPT
如果仍然有問題,就可能是SELinux導致的
關閉selinux:
修改/etc/selinux/config文件中的SELINUX="" 爲 disabled,然後重啓
===================================
[root@CC init.d]# systemctl start sshd.service [root@CC init.d]# systemctl enable sshd.service ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service' [root@CC init.d]# iptables -I INPUT -p tcp --dport 22 -j ACCEPT ===================================