我正在尝试安装 openssh-server。然后最后我收到错误:
ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2020-02-06 13:52:20 +04; 9ms ago
Process: 17679 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=255)
dpkg: error processing package openssh-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up ssh-import-id (5.5-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.27) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Rules updated for profile 'Apache Full'
Firewall reloaded
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
检查您的 dpkg 日志
/var/log/dpkg.log
。这可能会给你更多的信息。通读安装后脚本,看看您是否可以按照它在做什么。你可以在
/var/lib/dpkg/info/openssh-server.postinst
.检查脚本失败的原因:
重启ssh:
然后运行: