I've attached my mostly default configuration that does not exhibit the
problem as well as the configuration that does exhibit the problem.
Obviously, to reproduce this you'll need to use a ListenAddress and
perhaps a Port argument that suits your setup.

To reproduce this, take my original configuration, or simply ensure that
your sshd_config has no ListenAddress or Port arguments (anywhere, in
any order), and restart sshd, confirming it is listening on 22/TCP as
normal:

$  sudo /etc/init.d/ssh restart   
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop ssh ; start ssh. The restart(8) utility is also available.
ssh stop/waiting
ssh start/running, process 5968
$  sudo lsof -np 5968 |grep LISTEN
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/jhart/.gvfs
      Output information may be incomplete.
sshd    5968 root    3u  IPv4 8942314      0t0      TCP *:ssh (LISTEN)
sshd    5968 root    4u  IPv6 8942316      0t0      TCP *:ssh (LISTEN)


Then, take my modified configuration, or ensure that your ListenAddress 
specification is before the Port argument and the ListenAddress is set to 
something other than 0.0.0.0 (I think), and then restart sshd.  You'll see that 
it didn't start, and is not running or listening:

$  sudo /etc/init.d/ssh restart   
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop ssh ; start ssh. The restart(8) utility is also available.
ssh stop/waiting
ssh start/running, process 6008
$  sudo lsof -np 6008 |grep LISTEN
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/jhart/.gvfs
      Output information may be incomplete.
[ jhart@jhart-laptop (12/11/15 11:21:17) ~  <err: 1> ]                          
                                                                             
$  ps aux |grep sshd              
jhart     6048  0.0  0.0   9388   924 pts/4    S+   11:21   0:00 grep sshd


If you then swap the order of the ListenAddress and Port arguments, or use the 
combined ListenAddress:Port option, this works fine.

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

Title:
  sshd will fail to start or restart if non-default Port option is
  incorrectly put after a non-default ListenAddress

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to