我只想启动一个“活动” SSH 客户端,但在运行以下代码后出现错误:
sudo service ssh start
sudo systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Tue 2020-10-06 20:56:14 PDT; 8min ago
└─ ConditionPathExists=!/etc/ssh/sshd_not_to_be_run was not met
Docs: man:sshd(8)
man:sshd_config(5)
Oct 06 20:40:48 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:43:16 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:44:14 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:47:30 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:49:37 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:56:07 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
Oct 06 20:56:14 penguin systemd[1]: Condition check resulted in OpenBSD Secure Shell server being skipped
lines 1-15/15 (END)
有什么建议么?
答案1
如输出所示:
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run was not met
这意味着如果该文件存在,systemd 将不会启动该服务。
您需要先删除此文件,服务才能启动。
sudo rm -f /etc/ssh/sshd_not_to_be_run