Establish passwordless ssh between ubuntu and ESX host.

2 min readMar 4, 2021

Here we describe the procedure to establish passwordless SSH connection to ESX host from ubuntu machine.

  • First, let us login into the local machine and generate the authentication key through the following command.
ssh-keygen -t rsaGenerating public/private rsa key pair.
Enter file in which to save the key (/home/giri/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/giri/.ssh/id_rsa.
Your public key has been saved in /home/giri/.ssh/
The key fingerprint is:
SHA256:+7Rs50PhUaT2/ldhaB2nVoqx84o5GKsqbHvBPi+i/7c giri@giri-e2e
The key's randomart image is:
+---[RSA 2048]----+
| .. |
| ....o|
| o=o+o|
| .*+++ |
| . S ..*o .|
| o .. o.. .|
| . . . .+.+ .. .|
| = = . o+=.+ ..|
|.+o*o*Eo .++.. o|
  • After generating the key pair, the same has to be copied to the remote machine. In ESX, the location of ssh specific files are located in `/etc/ssh` directory. This is different from linux operating systems. So ,we need to copy the public key into that directory.
cat .ssh/ | ssh 'cat >> /etc/ssh/authorized_keys'

You will be prompted for remote machine’s password. After copying the public key successfully, the passwordless SSH to the remote machine will be established successfully.

user@machine1:~$ ssh
The time and date of this login have been sent to the system logs.
VMware offers supported, powerful system administration tools. Please
see for details.
The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.

Thus, we can enable passwordless SSH between linux and ESX host.