开启ssh服务:
service sshd start
service sshd stop
重启ssh服务:
servcie sshd restartSSH服务开机自动启动:
chkconfig sshd on
取消开机自启动:
chkconfig sshd off开启服务后,检查服务状态:
service sshd status
或
ssh username@localhost测试(前提必须安装了Linux下得ssh客户端软件包)
或者在Windows机器上,利用putty等ssh客户端工具远程连接。
若能成功登入,说明SSH服务已经可用。
若不能成功登入,请检查防火墙设置。查看防火墙状态:
/etc/init.d/iptables status
或
service iptables status
关闭防火墙:
/etc/rc.d/init.d/iptables stop
或
service iptables stop
或永久性关闭防火墙:
chkconfig iptables off
打开防火墙:
/etc/rc.d/init.d/iptables srart
或
service iptables start
或永久性关闭防火墙:
chkconfig iptables on