Establish passwordless ssh between ubuntu and ESX host.

  • 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/id_rsa.pub.
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|
+----[SHA256]-----+
  • 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/id_rsa.pub | ssh xxxxx@192.168.xxx.xxx 'cat >> /etc/ssh/authorized_keys'
user@machine1:~$ ssh root@192.168.xxx.xxx
The time and date of this login have been sent to the system logs.
VMware offers supported, powerful system administration tools. Please
see www.vmware.com/go/sysadmintools for details.
The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
[root@esx:~]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store