如何重启 CentOS 8 中的 SSH 服务
重启 SSH 服务的命令:
1 |
|
步骤详解:
访问终端:使用 SSH 或本地终端连接到您的 CentOS 8 服务器。
输入命令:键入以下命令并按 Enter:
1
systemctl restart sshd
验证服务状态:等待命令执行完毕后,使用以下命令验证 SSH 服务是否正在运行:
1
systemctl status sshd
输出应如下所示:
1 2 3 4 5 |
|
说明:
systemctl restart sshd 命令将重新启动 SSH 服务。
systemctl status sshd 命令将显示 SSH 服务的状态。
如果服务未运行,您可以使用 systemctl start sshd 命令启动它。