AWS Ubuntu 14 – Can't SSH After Reboot

Rich Jones asked:

Had an issue where an instance became unresponsive and was forced into a reboot. After the reboot I could ping the server but could not SSH into the server.

Ultimately I created a new instance and connected the volume to the new instance. However I would like to make sure when I reboot this instance I don’t run into the same problem.

Looking at the console log I see:

[ 2.968537] EXT4-fs (xvda1): INFO: recovery required on readonly filesystem

[ 2.972324] EXT4-fs (xvda1): write access will be enabled during recovery

[ 3.095607] EXT4-fs (xvda1): orphan cleanup on readonly fs

[ 3.354696] EXT4-fs (xvda1): 40 orphan inodes deleted

[ 3.358010] EXT4-fs (xvda1): recovery complete

[ 3.465864] EXT4-fs (xvda1): mounted filesystem with ordered data mode. Opts: (null)

My sshd_config file has two changes from the default UsePAM was set to no and PasswordAuthentication was set to yes. I don’t think that had anything to do with it.

My /etc/fstab file was set to:
LABEL=cloudimg-rootfs / ext4 defaults,discard 0 0
/dev/xvdb /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
/dev/xvdg /hd3 auto noatime 0 0

/dev/xvdf /hd3 auto noatime 0 0

/dev/xvdf /hd2 auto noatime 0 0
/dev/xvdh /hd4 auto noatime 0 0
/dev/xvdh /hd4 auto noatime 0 0
/dev/xvdi /vol auto noatime 0 0
/dev/xvdi /hd5 auto noatime 0 0

I checked all the obvious things like making sure I’m connecting to the right IP, etc.

Any idea on why this did not allow SSH?

My answer:


You said:

My sshd_config file has two changes from the default UsePAM was set to no and PasswordAuthentication was set to yes. I don’t think that had anything to do with it.

Actually that almost certainly is your problem. On a Linux system with PAM, attempting to login bypassing PAM is not guaranteed to work, and generally does not.

Set UsePAM yes and try again.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.