Tuesday, May 17, 2011

Enabling root SSH login on an ESX host

http://kb.vmware.com/kb/8375637
...because it's disabled out of the box.


To create a user in ESX host for using a SSH client:
  1. Log in to the vSphere Client as a root user.
  2. Click Users & Groups.
  3. Right-click on a blank area and click Add.
  4. Enter a username and password. Confirm your password.
    Note: Starting in ESX 4.0, the password needs to be at least 8 characters in length.
  5. Select Grant shell access to this user.
  6. Select root group from the dropdown and click Add > OK.

    Note: By default it assigns to the users group and does not allow SSH access.
After you are logged in SSH session, switch to the root user with the command:
su -

Edit the configuration file for SSH with the command:
nano /etc/ssh/sshd_config

Find the line that starts with PermitRootLogin and change the no to yes. You can find this line about 2 pages down from the top.

Save the file by first pressing Ctrl-O and then Enter. Exit with Ctrl-X. Restart the sshd service with the command:
service sshd restart
... or alternatively, use the command:
/etc/init.d/sshd restart


No comments:

Post a Comment