Wrong directive in config file cause server to crash

Bug #911753 reported by 周成瑞
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

I added "PermitUserEnvironment Yes" in sshd_config file, and the server cannot start at all. Every attempt to start the server results in such error messages at the end of this report.

The reason is I used 'Yes', which should be 'yes'. It is hard to find, since when starting the server, it seems OK:

$ sudo /etc/init.d/ssh start
[sudo] password for tux:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
ssh start/running, process 5780

It does not report it as a config file error.

--------------

Syslog message:

Jan 4 21:21:16 Neverland kernel: [ 5271.135175] init: ssh main process (5780) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.135236] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.147909] init: ssh main process (5783) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.147950] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.155092] init: ssh main process (5786) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.155127] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.163840] init: ssh main process (5789) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.163873] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.171317] init: ssh main process (5792) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.171348] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.178720] init: ssh main process (5795) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.178764] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.186037] init: ssh main process (5798) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.186080] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.194536] init: ssh main process (5801) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.194579] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.203290] init: ssh main process (5804) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.203331] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.210991] init: ssh main process (5807) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.211026] init: ssh main process ended, respawning
Jan 4 21:21:16 Neverland kernel: [ 5271.217402] init: ssh main process (5810) terminated with status 255
Jan 4 21:21:16 Neverland kernel: [ 5271.217424] init: ssh respawning too fast, stopped

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: openssh-server 1:5.8p1-7ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-14.23-generic 3.0.9
Uname: Linux 3.0.0-14-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Wed Jan 4 21:20:43 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SSHDConfig: Error: command ['gksu', '-D', 'Apport', '--', '/usr/sbin/sshd', '-T'] failed with exit code 255:
SourcePackage: openssh
UpgradeStatus: Upgraded to oneiric on 2011-10-14 (81 days ago)

Revision history for this message
周成瑞 (e93b5ae3) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to submit this bug. Certainly it would be nice if there were a meaningful error message in syslog explaining why ssh failed to start.

Changed in openssh (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
J (profetasdelmetal) wrote :

Hi, I had the exact same error on my syslog because my config wasn't valid.

I had at the end of my config.

Match Group sftp
Subsystem sftp internal-sftp
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no

The problem was Subsystem has to be placed outside (before) Match's

Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory %h
AllowTCPForwarding no
ForceCommand internal-sftp

Revision history for this message
Firat Sarlar (sfirat) wrote :

Something similar has happened to me, I'm still trying to recover my EC2 instance ..

In Upstart config file ,
instead of

-- exec /usr/sbin/sshd -D

inside scricpt block
doing a config test with -t parameter
 and revert to a backup config like /etc/ssh/sshd_config.bk if config test fails
could save someone from trouble..

++
script

    if [ "$(/usr/sbin/sshd -t 2>&1)" != "" ]; then
            exec /usr/sbin/sshd -D -f /etc/ssh/sshd_config.bk
    else
            exec /usr/sbin/sshd -D
    fi

end script

++

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.