知识篇 -- 【SSHD】查询、启动、重启
记录 CentOS Linux SSHD 查询、启动、重启及设置开机自启动命令
CentOS 7以下:
# 查看状态
service sshd status
# 启动服务
service sshd start
# 重启服务
service sshd restart
# 关闭服务
service sshd stop
# 设置开机自启动 (–level 指定系统在2345运行级别时)。
chkconfig --level 2345 sshd on
CentOS 7及以上
# 查看状态
systemctl status sshd.service
# 启动服务
systemctl start sshd.service
# 重启服务
systemctl restart sshd.service
# 关闭服务
systemctl stop sshd.service
# 设置开机自启动
systemctl enable sshd.service