Enabling root SSH login on an ESX host
Sure, there's KB 8375637 covering exactly that. In it we can read how to do this when we have physical access to the ESX host. But we don't and we have just setup our ESX host, so we don't have any other users available. But then there's KB 1317898, explaining how to change a forgotten root password on an ESX host. In short:
- Reboot the ESX host
- In the GRUB menu, scroll down to Troubleshooting mode and press "e" to edit and add
"single"to the end of the kernel line. We may also add
console=ttyS0,115200n8to do this via a serial console.
- Boot the ESX. We should now be in single-user-mode with a root shell.
- If so, we can allow
sshdroot-logins (and make a few more adjustments, while we're at it):
$ sed 's/^PermitRootLogin.*/PermitRootLogin yes/' -i /etc/ssh/sshd_config $ grep kernel /boot/grub/grub.conf kernel /vmlinuz [...] console=ttyS0,115200n8 kernel /trouble/vmlinuz [...] trouble console=ttyS0,115200n8 $ grep ttyS0 /etc/inittab S:2345:respawn:/sbin/agetty 115200 ttyS0 $ grep ttyS0 /etc/securetty ttyS0
sync(1)and reboot. We should now be able to login locally (via a serial console) or via ssh. Yay! :-)
> esx01.local > Warning > Status of other host hardware objects > 1/12/2011 1:25:31 AMHuh? What is the status of "other host hardware objects"? After a bit of clicking around we navigate to the "Hardware Status" tab and there it is:
System Management Software 0 Event Logging: Log full,out of 94 sensorsTurns out, our SEL was full and needed to be cleared:
ilom$ ipmi clear selWhen we "update" the hardware status page, the warning should be gone.