[Bug 1071264] Re: sshd cannot be remotely restarted from an ssh session

Robie Basak 1071264 at bugs.launchpad.net
Thu Oct 25 12:07:16 UTC 2012


Thank you for taking the time to report this bug and helping to make
Ubuntu better.

I have been unable to reproduce this. "sudo restart ssh" works for me on
both Precise (1:5.9p1-5ubuntu1) and Quantal (1:6.0p1-3ubuntu1) without
any errors. upstart reports a new pid, and /var/log/auth.log gives me
the following:

Oct 25 12:03:25 <hostname> sshd[11126]: Server listening on 0.0.0.0 port 22.
Oct 25 12:03:25 <hostname> sshd[11126]: Server listening on :: port 22.

Please could you give us steps to reproduce this?

** Changed in: openssh (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/1071264

Title:
  sshd cannot be remotely restarted from an ssh session

Status in “openssh” package in Ubuntu:
  Incomplete

Bug description:
  Maybe this is a request for enhancement... but it works in Fedora, so
  I'm guessing it's intended to work in ubuntu 8^).

  In Fedora, I can ssh into a remote host,  issue 'systemctl restart
  sshd.service' (or in earlier versions, 'service sshd restart'), and
  the result is that sshd restarts - in particular, re-reading its
  config file. Not only that, but the ssh session I am logged in on is
  preserved.

  In ubuntu, the equivalent actions - 'service ssh restart',
  '/etc/init.d/ssh restart' and 'restart ssh' all fail with "error: Bind
  to port 22 on 0.0.0.0 failed: Address already in use." I guess that is
  because my current ssh session prevents the current instance of sshd
  shutting down. But somehow Fedora manages it...

  Steps to recreate:
  1. ssh to remote server
  2. sudo edit /etc/ssh/sshd_config, or other relevant file
  3. sudo restart ssh

  Actual result:
  error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
  (and sshd fails to restart)

  Expected result:
  sshd restarts (preferably with running ssh sessions intact, but even killing the running ssh sessions would be preferable to current state).

  The bottom line is that minor sshd reconfigurations on remote Fedora
  systems require only a restart of the sshd daemon. On ubuntu, they
  require a full reboot (which you may want to keep to a minimum on a
  remote system that you don't have physical access to). I realise that
  preserving the running ssh sessions over an sshd restart might be
  complex (and even undesirable, because it could lead to security
  issues with sessions still running with configurations that are
  intended to be fixed). But even having the sshd restart kill the
  connections of the current running sessions (so that it would be
  necessary to log in again) would be better than the current setup.

  Apologies if this has already been discussed - googling and ubuntu
  searches failed to turn it up.

  System: 
  Description:	Ubuntu 10.04.4 LTS
  Release:	10.04

  Package:
  openssh-server:
    Installed: 1:5.3p1-3ubuntu7
    Candidate: 1:5.3p1-3ubuntu7
    Version table:
   *** 1:5.3p1-3ubuntu7 0
          500 http://archive.ubuntu.com/ubuntu/ lucid-updates/main Packages
          100 /var/lib/dpkg/status
       1:5.3p1-3ubuntu3 0
          500 http://archive.ubuntu.com/ubuntu/ lucid/main Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1071264/+subscriptions




More information about the foundations-bugs mailing list