cnetos ssh相关命令
启动、关闭、重启
# 启动
systemctl start sshd.service
# 关闭
systemctl stop sshd.service
# 重启
systemctl restart sshd.service
# 开机自启动
systemctl enable sshd.service
# 查看firewall服务状态
systemctl status firewalld
# 查看状态
systemctl status sshd.service
修改端口
# 修改/etc/ssh/sshd_config文件里的 Port 22
vim /etc/ssh/sshd_config
# 修改后重启ssh生效
systemctl restart sshd.service
全部评论