To resolve this issue, enable SSH access for non-root users.
To enable SSH access for non-root users:
- Create a user account on the ESXi 4.x host using one of these options:
- Create a user account using the vSphere Client.
Using the vSphere Client:
- Connect to the host directly using the vSphere Client with root credentials.
- Click the Local Users & Groups tab.
- Right-click anywhere in the tab, then click Add.
- Enter a log in name and password.
- Click OK.
- Create a user account using the useradd command.
Using the useradd command:
Note: Remember to set a password for this user account.
- Connect to the host via SSH with root credentials:
mkdir -p /home/username
- Create the user:
useradd test -d /home/username -s /bin/bashConnect to the host directly using the vSphere Client with root credentials.
- Click the Permissions tab.
- Right-click Add Permission then click Add.
- Select the newly created local user from the list and click Add.
- Assign the Administrator role to the user then click OK.
- Verify the user is setup correctly when connected to the host via SSH as root:
-
- Take a backup of the /etc/passwd file.
- Verify if the user's /home/username directory exists. If not, create it with the command:
mkdir -p /home/username
- Edit the /etc/passwd file and locate the new user account you have created:
Note: By default in an ESXi 4.1 host, the new user account is created with the shell set to /sbin/nologin. In an ESXi 4.0 host, it is set to /bin/false.
- Set the shell to:
/bin/bash
- Set the /home directory to the user's /home/username directory.
- Save and quit the file.
- Restart the inetd service with the command:
services.sh restart