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
 
===================================