首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ubuntu 20.04上的openssh服务器问题

ubuntu 20.04上的openssh服务器问题
EN

Ask Ubuntu用户
提问于 2021-05-26 09:45:33
回答 1查看 7.2K关注 0票数 4

我的机器上的openssh服务器好像出了问题。我在Ubuntu 20.04。我注意到这是在试图安装另一个依赖于openssh服务器的包。

当我试图重新安装时,它说它正在配置一个“部分安装的包”,所以我想我在之前的升级中一定错过了这个包发生的事情。

代码语言:javascript
运行
复制
andy@andy-UX303UA:~$ sudo aptitude install openssh-server
The following partially installed packages will be configured:
  openssh-server 
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up openssh-server (1:8.2p1-4ubuntu0.2) ...
rescue-ssh.target is a disabled or a static unit, not starting it.
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
invoke-rc.d: initscript ssh, action "restart" failed.
● 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 Wed 2021-05-26 10:25:29 BST; 9ms ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 45270 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)

May 26 10:25:29 andy-UX303UA systemd[1]: Failed to start OpenBSD Secure Shell server.
dpkg: error processing package openssh-server (--configure):
 installed openssh-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up openssh-server (1:8.2p1-4ubuntu0.2) ...
rescue-ssh.target is a disabled or a static unit, not starting it.
Job for ssh.service failed because the control process exited with error code.
See "systemctl status ssh.service" and "journalctl -xe" for details.
invoke-rc.d: initscript ssh, action "restart" failed.
● 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 Wed 2021-05-26 10:25:34 BST; 9ms ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 45546 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)
dpkg: error processing package openssh-server (--configure):
 installed openssh-server package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 openssh-server
                                         
andy@andy-UX303UA:~$ apt-cache policy openssh-server
openssh-server:
  Installed: 1:8.2p1-4ubuntu0.2
  Candidate: 1:8.2p1-4ubuntu0.2
  Version table:
 *** 1:8.2p1-4ubuntu0.2 500
        500 http://gb.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1:8.2p1-4 500
        500 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 Packages

建议的地方寻找更多的细节,但在我看来似乎没有特别的信息。

代码语言:javascript
运行
复制
andy@andy-UX303UA:~$ systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-05-26 10:27:27 BST; 7min ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 45953 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=1/FAILURE)

May 26 10:27:26 andy-UX303UA systemd[1]: Failed to start OpenBSD Secure Shell server.
May 26 10:27:27 andy-UX303UA systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
May 26 10:27:27 andy-UX303UA systemd[1]: Stopped OpenBSD Secure Shell server.
May 26 10:27:27 andy-UX303UA systemd[1]: ssh.service: Start request repeated too quickly.
May 26 10:27:27 andy-UX303UA systemd[1]: ssh.service: Failed with result 'exit-code'.
May 26 10:27:27 andy-UX303UA systemd[1]: Failed to start OpenBSD Secure Shell server.
代码语言:javascript
运行
复制
andy@andy-UX303UA:~$ journalctl -xe
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit ssh.service has finished with a failure.
-- 
-- The job identifier is 17319 and the job result is failed.
May 26 10:36:35 andy-UX303UA update-notifier.desktop[47663]: /var/lib/dpkg/lock:
May 26 10:36:35 andy-UX303UA systemd[1]: ssh.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit ssh.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
May 26 10:36:35 andy-UX303UA systemd[1]: Stopped OpenBSD Secure Shell server.
-- Subject: A stop job for unit ssh.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A stop job for unit ssh.service has finished.
-- 
-- The job identifier is 17399 and the job result is done.
May 26 10:36:35 andy-UX303UA systemd[1]: ssh.service: Start request repeated too quickly.
May 26 10:36:35 andy-UX303UA systemd[1]: ssh.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit ssh.service has entered the 'failed' state with result 'exit-code'.
May 26 10:36:35 andy-UX303UA systemd[1]: Failed to start OpenBSD Secure Shell server.
-- Subject: A start job for unit ssh.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit ssh.service has finished with a failure.
-- 
-- The job identifier is 17399 and the job result is failed.
May 26 10:36:35 andy-UX303UA anacron[46167]: Job `cron.daily' terminated
May 26 10:36:35 andy-UX303UA anacron[46167]: Normal exit (1 job run)
May 26 10:36:35 andy-UX303UA systemd[1]: anacron.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit anacron.service has successfully entered the 'dead' state.
May 26 10:36:36 andy-UX303UA gnome-shell[1916]: JS ERROR: TypeError: windowActor is null
                                                _addWindowEffect@resource:///org/gnome/shell/ui/clos>
                                                vfunc_show@resource:///org/gnome/shell/ui/closeDialo>
May 26 10:36:37 andy-UX303UA sudo[46492]: pam_unix(sudo:session): session closed for user root
May 26 10:36:41 andy-UX303UA gnome-shell[1916]: JS ERROR: TypeError: windowActor is null
                                                _addWindowEffect@resource:///org/gnome/shell/ui/clos>
                                                vfunc_show@resource:///org/gnome/shell/ui/closeDialo>
May 26 10:36:46 andy-UX303UA gnome-shell[1916]: JS ERROR: TypeError: windowActor is null
                                                _addWindowEffect@resource:///org/gnome/shell/ui/clos>
                                                vfunc_show@resource:///org/gnome/shell/ui/closeDialo>
lines 2174-2227/2227 (END)

在运行aptitude remove openssh-server并试图重新安装它之后,我得到了相同的错误。知道接下来该做什么吗?

我的ubuntu版本:

代码语言:javascript
运行
复制
andy@andy-UX303UA:~$ lsb_release -a
LSB Version:    core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2021-05-26 10:39:58

我不知道aptitude remove是否清除了配置,在我的理解中,手册页面并不那么清晰。而不是aptitude remove openssh-server,您可以尝试apt-get purge openssh-server,然后再安装该软件包。

如果这没有帮助,您可以尝试获取有关此错误的更多信息:

代码语言:javascript
运行
复制
dpkg: error processing package openssh-server (--configure):
installed openssh-server package post-installation script subprocess returned error exit status 1

了解安装后脚本失败的原因将很有帮助。在(重新)安装软件包之后,可以运行dpkg-reconfigure openssh-server。我认为这是值得一试的,因为单独执行这个步骤可能会提供更多的信息,而不是让它被智能所包裹。

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1340752

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档