ESX 4/5 – Grant Root User SSH Access

for ESXi click here

KB ID 0000278 

Problem

ESX is built on Linux – and in the Linux environment, to root user is denied SSH access, there are valid security reasons for this, and you can SSH to the ESX box as a normal user and then issue the “su -” command to switch to root access.

However, some of us still want to SSH in as root, here’s how to do it.

Solution

1. Create a user on your ESX Server (Ensure the user is granted “Shell access”).

2. Connect to your ESX server via SSH (using PuTTy) with the credentials you created above.(Note: if using another SSH client, use SSH2).

3. Execute the following command,

[box]su -[/box]

4. Give it the root password.

5. Execute the following command,

[box]cd /etc/ssh[/box]

6. Execute the following command,

[box]nano sshd_config[/box]

7. Locate the line saying PermitRootLogin no and change it to Yes (Note: Use the arrow keys).

8. Type CTRL+X answer Y for Yes > Then press Enter to confirm.

9. Execute the following commands,

[box]

service sshd restart
esxcfg-firewall -e sshServer
esxcfg-firewall -e sshClient

[/box]

Related Articles, References, Credits, or External Links

NA