#767320 openssh-server: doesn't start at boot

Package:
openssh-server
Source:
openssh
Description:
secure shell (SSH) server, for secure access from remote machines
Submitter:
Date:
2015-02-18 19:51:10 UTC
Severity:
normal
#767320#5
Date:
2014-10-30 06:26:49 UTC
From:
To:
Hi,
I discovered that my laptop daily backups to my home Backuppc server
haven't been running since Oct 1, when I installed the latest Jessie
upgrades.  Logs showed that Backuppc couldn't connect
 to the laptop because sshd wasn't running. Restarting by
"etc/init.d/ssh restart" or "systemctl start sshd.service start
sshd.service" work and my backups run.

It seems that I've been using 3 different versions of openssh-server
during this time.
  openssh-server (1:6.6p1-7)
  openssh-server (1:6.6p1-7) to 1:6.6p1-8
  openssh-server (1:6.6p1-8) to 1:6.7p1-2

Just after a boot:

$ sudo systemctl status sshd.service
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
   Active: failed (Result: start-limit) since Tue 2014-10-28 12:44:46
NZDT; 2min 3s ago
  Process: 987 ExecStart=/usr/sbin/sshd -D $SSHD_OPTS (code=exited,
status=255)
 Main PID: 987 (code=exited, status=255)

Oct 28 12:44:46 ithilien systemd[1]: ssh.service: main process exited,
code=exited, status=255/n/a
Oct 28 12:44:46 ithilien systemd[1]: Unit ssh.service entered failed
state.
Oct 28 12:44:46 ithilien systemd[1]: ssh.service start request repeated
too quickly, refusing to start.
Oct 28 12:44:46 ithilien systemd[1]: Failed to start OpenBSD Secure
Shell server.
Oct 28 12:44:46 ithilien systemd[1]: Unit ssh.service entered failed
state.


I read #757822 - openssh-server: systemd start-limit reached after
bootup, causing sshd to be stopped, but that seemed diffferent, at least
to me.

Anything else I should report?

Thanks,
V

#767320#10
Date:
2014-11-07 16:12:08 UTC
From:
To:
There could be a few reasons for that.  Could you check to see whether
there's anything useful in /var/log/auth.log (or rotated versions of
that file) at this time, and if so post the log fragments?

Thanks,

#767320#15
Date:
2014-11-07 22:28:35 UTC
From:
To:
Hi,

I do have a modified sshd_config, to only Listen on some interfaces
/etc/ssh/sshd_config
        #ListenAddress ::::
        #ListenAddress 0.0.0.0
        ListenAddress 192.168.1.13
        ListenAddress 192.168.1.12
        ListenAddress 10.1.1.1
        Protocol 2


Here's /var/log/auth.log from this morning's boot. At the end I start
the service manually.

        Nov  8 10:54:57 ithilien sshd[962]: error: Bind to port 22 on 10.1.1.1 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[962]: error: Bind to port 22 on 192.168.1.12 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[962]: error: Bind to port 22 on 192.168.1.13 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[962]: fatal: Cannot bind any address.
        Nov  8 10:54:57 ithilien sshd[979]: error: Bind to port 22 on 10.1.1.1 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[979]: error: Bind to port 22 on 192.168.1.12 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[979]: error: Bind to port 22 on 192.168.1.13 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[979]: fatal: Cannot bind any address.
        Nov  8 10:54:57 ithilien sshd[981]: error: Bind to port 22 on 10.1.1.1 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[981]: error: Bind to port 22 on 192.168.1.12 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[981]: error: Bind to port 22 on 192.168.1.13 failed: Cannot assign requested address.
        Nov  8 10:54:57 ithilien sshd[981]: fatal: Cannot bind any address.
        Nov  8 10:54:58 ithilien sshd[983]: error: Bind to port 22 on 10.1.1.1 failed: Cannot assign requested address.
        Nov  8 10:54:58 ithilien sshd[983]: error: Bind to port 22 on 192.168.1.12 failed: Cannot assign requested address.
        Nov  8 10:54:58 ithilien sshd[983]: error: Bind to port 22 on 192.168.1.13 failed: Cannot assign requested address.
        Nov  8 10:54:58 ithilien sshd[983]: fatal: Cannot bind any address.
        Nov  8 10:54:58 ithilien gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session opened for user Debian-gdm by (uid=0)
        Nov  8 10:54:58 ithilien systemd-logind[880]: New session c1 of user Debian-gdm.
        Nov  8 10:54:58 ithilien systemd: pam_unix(systemd-user:session): session opened for user Debian-gdm by (uid=0)
        Nov  8 10:55:01 ithilien polkitd(authority=local): Registered Authentication Agent for unix-session:c1 (system bus name :1.21 [gnome-shell --mode=gdm], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_NZ.UTF-8)
        Nov  8 10:55:07 ithilien gdm-password]: pam_unix(gdm-password:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=v
        Nov  8 10:55:11 ithilien gdm-password]: pam_unix(gdm-password:session): session opened for user v by (unknown)(uid=0)
        Nov  8 10:55:11 ithilien systemd-logind[880]: New session 1 of user v.
        Nov  8 10:55:11 ithilien systemd: pam_unix(systemd-user:session): session opened for user v by (uid=0)
        Nov  8 10:55:11 ithilien polkitd(authority=local): Unregistered Authentication Agent for unix-session:c1 (system bus name :1.21, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_NZ.UTF-8) (disconnected from bus)
        Nov  8 10:55:14 ithilien polkitd(authority=local): Registered Authentication Agent for unix-session:1 (system bus name :1.70 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_NZ.UTF-8)
        Nov  8 10:55:18 ithilien pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1001)
        Nov  8 10:55:18 ithilien pkexec[1881]: v: Executing command [USER=root] [TTY=unknown] [CWD=/home/v] [COMMAND=/usr/lib/gnome-settings-daemon/gsd-backlight-helper --set-brightness 52]
        Nov  8 10:55:25 ithilien polkitd(authority=local): Operator of unix-session:1 successfully authenticated as unix-user:v to gain ONE-SHOT authorization for action com.ubuntu.pkexec.synaptic for unix-process:1893:28419 [/bin/sh /usr/bin/synaptic-pkexec] (owned by unix-user:v)
        Nov  8 10:55:25 ithilien pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1001)
        Nov  8 10:55:25 ithilien pkexec[1895]: v: Executing command [USER=root] [TTY=unknown] [CWD=/home/v] [COMMAND=/usr/sbin/synaptic]
        Nov  8 10:55:31 ithilien systemd-logind[880]: Removed session c1.
        Nov  8 10:55:31 ithilien systemd: pam_unix(systemd-user:session): session closed for user Debian-gdm
        Nov  8 11:09:01 ithilien CRON[25527]: pam_unix(cron:session): session opened for user root by (uid=0)
        Nov  8 11:09:01 ithilien CRON[25527]: pam_unix(cron:session): session closed for user root
        Nov  8 11:14:50 ithilien sudo: pam_unix(sudo:auth): authentication failure; logname=v uid=1001 euid=0 tty=/dev/pts/0 ruser=v rhost=  user=v
        Nov  8 11:14:55 ithilien sudo:        v : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/sbin/ifconfig
        Nov  8 11:14:55 ithilien sudo: pam_unix(sudo:session): session opened for user root by v(uid=0)
        Nov  8 11:14:55 ithilien sudo: pam_unix(sudo:session): session closed for user root
        Nov  8 11:15:46 ithilien sudo:        v : TTY=pts/0 ; PWD=/etc/ssh ; USER=root ; COMMAND=/etc/init.d/ssh restart
        Nov  8 11:15:46 ithilien sudo: pam_unix(sudo:session): session opened for user root by v(uid=0)
        Nov  8 11:15:46 ithilien sshd[25927]: error: Bind to port 22 on 10.1.1.1 failed: Cannot assign requested address.
        Nov  8 11:15:46 ithilien sshd[25927]: Server listening on 192.168.1.12 port 22.
        Nov  8 11:15:46 ithilien sshd[25927]: error: Bind to port 22 on 192.168.1.13 failed: Cannot assign requested address.
        Nov  8 11:15:46 ithilien sudo: pam_unix(sudo:session): session closed for user root


Hope it helps,
V

#767320#20
Date:
2015-02-17 20:44:08 UTC
From:
To:
Good news. Today sshd started on boot.

Maybe it got fixed in yesterday's updates:

#767320#25
Date:
2015-02-18 19:46:56 UTC
From:
To:
Spoke too soon. sshd did not start this morning.

From syslog, the first mention of sshd

V