Failed to start OpenBSD Secure Shell server error when I try to run apt-get or to install Ubuntu upgrades












0















I am on Ubuntu 16.4 LTS.
I had ssh server running and it worked properly for many months, until one time when something cause it to fail.



Now, I can't do regular Ubuntu updates from Canonical. I can't run apt-get updates. E.g.



sudo apt-get upgrade python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.5.1-3).
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
containerd libllvm5.0 libpaps0 paps python3-rlp runc swarm
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up openssh-server (1:7.2p2-4ubuntu2.6) ...
insserv: warning: script 'S02ssh-start.sh' missing LSB tags and overrides
insserv: warning: script 'ssh-start.sh' missing LSB tags and overrides
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: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 6ms ago
Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 79047 (code=exited, status=255)

Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.
dpkg: error processing package openssh-server (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)


When I check the status of my ssh server,



sudo service ssh status

● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 2min 37s ago
Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 79047 (code=exited, status=255)

Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.


Thank you for help.



-- edit 1/28/19 --



I don't know if this helps, but I have in /etc/init.d tow following 2 scripts...



ssh.sh


which appears to be the ubuntu provided shell script



and



ssh-start.sh


which contain



sudo service ssh start


in addition to all that, I also have /etc/systemd/system/sshd.service, which is a link to /lib/systemd/system/ssh.service



which contains:



[Unit]
Description=OpenBSD Secure Shell server
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=sshd.service









share|improve this question





























    0















    I am on Ubuntu 16.4 LTS.
    I had ssh server running and it worked properly for many months, until one time when something cause it to fail.



    Now, I can't do regular Ubuntu updates from Canonical. I can't run apt-get updates. E.g.



    sudo apt-get upgrade python3
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    python3 is already the newest version (3.5.1-3).
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
    containerd libllvm5.0 libpaps0 paps python3-rlp runc swarm
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Setting up openssh-server (1:7.2p2-4ubuntu2.6) ...
    insserv: warning: script 'S02ssh-start.sh' missing LSB tags and overrides
    insserv: warning: script 'ssh-start.sh' missing LSB tags and overrides
    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: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 6ms ago
    Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
    Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
    Main PID: 79047 (code=exited, status=255)

    Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
    Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.
    dpkg: error processing package openssh-server (--configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    openssh-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    When I check the status of my ssh server,



    sudo service ssh status

    ● ssh.service - OpenBSD Secure Shell server
    Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 2min 37s ago
    Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
    Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
    Main PID: 79047 (code=exited, status=255)

    Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
    Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
    Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.


    Thank you for help.



    -- edit 1/28/19 --



    I don't know if this helps, but I have in /etc/init.d tow following 2 scripts...



    ssh.sh


    which appears to be the ubuntu provided shell script



    and



    ssh-start.sh


    which contain



    sudo service ssh start


    in addition to all that, I also have /etc/systemd/system/sshd.service, which is a link to /lib/systemd/system/ssh.service



    which contains:



    [Unit]
    Description=OpenBSD Secure Shell server
    After=network.target auditd.service
    ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

    [Service]
    EnvironmentFile=-/etc/default/ssh
    ExecStartPre=/usr/sbin/sshd -t
    ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
    ExecReload=/usr/sbin/sshd -t
    ExecReload=/bin/kill -HUP $MAINPID
    KillMode=process
    Restart=on-failure
    RestartPreventExitStatus=255
    Type=notify

    [Install]
    WantedBy=multi-user.target
    Alias=sshd.service









    share|improve this question



























      0












      0








      0








      I am on Ubuntu 16.4 LTS.
      I had ssh server running and it worked properly for many months, until one time when something cause it to fail.



      Now, I can't do regular Ubuntu updates from Canonical. I can't run apt-get updates. E.g.



      sudo apt-get upgrade python3
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      python3 is already the newest version (3.5.1-3).
      Calculating upgrade... Done
      The following packages were automatically installed and are no longer required:
      containerd libllvm5.0 libpaps0 paps python3-rlp runc swarm
      Use 'sudo apt autoremove' to remove them.
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Do you want to continue? [Y/n] Y
      Setting up openssh-server (1:7.2p2-4ubuntu2.6) ...
      insserv: warning: script 'S02ssh-start.sh' missing LSB tags and overrides
      insserv: warning: script 'ssh-start.sh' missing LSB tags and overrides
      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: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 6ms ago
      Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
      Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
      Main PID: 79047 (code=exited, status=255)

      Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
      Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.
      dpkg: error processing package openssh-server (--configure):
      subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
      openssh-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      When I check the status of my ssh server,



      sudo service ssh status

      ● ssh.service - OpenBSD Secure Shell server
      Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 2min 37s ago
      Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
      Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
      Main PID: 79047 (code=exited, status=255)

      Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
      Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.


      Thank you for help.



      -- edit 1/28/19 --



      I don't know if this helps, but I have in /etc/init.d tow following 2 scripts...



      ssh.sh


      which appears to be the ubuntu provided shell script



      and



      ssh-start.sh


      which contain



      sudo service ssh start


      in addition to all that, I also have /etc/systemd/system/sshd.service, which is a link to /lib/systemd/system/ssh.service



      which contains:



      [Unit]
      Description=OpenBSD Secure Shell server
      After=network.target auditd.service
      ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

      [Service]
      EnvironmentFile=-/etc/default/ssh
      ExecStartPre=/usr/sbin/sshd -t
      ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
      ExecReload=/usr/sbin/sshd -t
      ExecReload=/bin/kill -HUP $MAINPID
      KillMode=process
      Restart=on-failure
      RestartPreventExitStatus=255
      Type=notify

      [Install]
      WantedBy=multi-user.target
      Alias=sshd.service









      share|improve this question
















      I am on Ubuntu 16.4 LTS.
      I had ssh server running and it worked properly for many months, until one time when something cause it to fail.



      Now, I can't do regular Ubuntu updates from Canonical. I can't run apt-get updates. E.g.



      sudo apt-get upgrade python3
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      python3 is already the newest version (3.5.1-3).
      Calculating upgrade... Done
      The following packages were automatically installed and are no longer required:
      containerd libllvm5.0 libpaps0 paps python3-rlp runc swarm
      Use 'sudo apt autoremove' to remove them.
      0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Do you want to continue? [Y/n] Y
      Setting up openssh-server (1:7.2p2-4ubuntu2.6) ...
      insserv: warning: script 'S02ssh-start.sh' missing LSB tags and overrides
      insserv: warning: script 'ssh-start.sh' missing LSB tags and overrides
      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: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 6ms ago
      Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
      Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
      Main PID: 79047 (code=exited, status=255)

      Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
      Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.
      dpkg: error processing package openssh-server (--configure):
      subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
      openssh-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      When I check the status of my ssh server,



      sudo service ssh status

      ● ssh.service - OpenBSD Secure Shell server
      Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
      Active: failed (Result: exit-code) since Mon 2019-01-28 14:10:23 EST; 2min 37s ago
      Process: 79047 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited, status=255)
      Process: 79038 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
      Main PID: 79047 (code=exited, status=255)

      Jan 28 14:10:23 joeslinux systemd[1]: Starting OpenBSD Secure Shell server...
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Main process exited, code=exited, status=255/n/a
      Jan 28 14:10:23 joeslinux systemd[1]: Failed to start OpenBSD Secure Shell server.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Unit entered failed state.
      Jan 28 14:10:23 joeslinux systemd[1]: ssh.service: Failed with result 'exit-code'.


      Thank you for help.



      -- edit 1/28/19 --



      I don't know if this helps, but I have in /etc/init.d tow following 2 scripts...



      ssh.sh


      which appears to be the ubuntu provided shell script



      and



      ssh-start.sh


      which contain



      sudo service ssh start


      in addition to all that, I also have /etc/systemd/system/sshd.service, which is a link to /lib/systemd/system/ssh.service



      which contains:



      [Unit]
      Description=OpenBSD Secure Shell server
      After=network.target auditd.service
      ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

      [Service]
      EnvironmentFile=-/etc/default/ssh
      ExecStartPre=/usr/sbin/sshd -t
      ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
      ExecReload=/usr/sbin/sshd -t
      ExecReload=/bin/kill -HUP $MAINPID
      KillMode=process
      Restart=on-failure
      RestartPreventExitStatus=255
      Type=notify

      [Install]
      WantedBy=multi-user.target
      Alias=sshd.service






      apt server upgrade ssh






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 28 at 21:20







      Joe Molnar

















      asked Jan 28 at 19:27









      Joe MolnarJoe Molnar

      114




      114






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I had the same problem, I used workaround 2 from this link SSH Server stops working after reboot, caused by missing /var/run/sshd



          I think the issue for me is my kernal is too old, best of luck






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113607%2ffailed-to-start-openbsd-secure-shell-server-error-when-i-try-to-run-apt-get-or-t%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I had the same problem, I used workaround 2 from this link SSH Server stops working after reboot, caused by missing /var/run/sshd



            I think the issue for me is my kernal is too old, best of luck






            share|improve this answer




























              0














              I had the same problem, I used workaround 2 from this link SSH Server stops working after reboot, caused by missing /var/run/sshd



              I think the issue for me is my kernal is too old, best of luck






              share|improve this answer


























                0












                0








                0







                I had the same problem, I used workaround 2 from this link SSH Server stops working after reboot, caused by missing /var/run/sshd



                I think the issue for me is my kernal is too old, best of luck






                share|improve this answer













                I had the same problem, I used workaround 2 from this link SSH Server stops working after reboot, caused by missing /var/run/sshd



                I think the issue for me is my kernal is too old, best of luck







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 28 at 22:38









                Andrew DunnAndrew Dunn

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1113607%2ffailed-to-start-openbsd-secure-shell-server-error-when-i-try-to-run-apt-get-or-t%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?