Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

VMware Server 2.x: Enable the SSH daemon and configure identity key authentication according to the underlying VM host OS

ESX/ESXi 3.5 & 4.0: http://kb.vmware.com/kb/1003677

  • Connect to the console of the ESX/ESXi host
  • Press ALT-F1 - you should see a black screen with the VMware product name at the top
  • Type the word unsupported and press Enter (you won't see the letters appear as you type them)
  • You should see a password prompt, type in the root password and press Enter
  • Edit the file: vi /etc/inetd.conf
  • Uncomment the first line beginning with #ssh by deleting the # character
  • Save the file - press Esc and then :wq
  • Kill the inetd process
    • Determine the PID of the inetd process: ps | grep inetd
      You should see a line that looks like: 5065 5065 busybox inetd
    • Kill the process (enter the PID from the output of the previous command): kill -HUP 5065

Beginning with ESXi 4.1, SSH can be enabled using the vSphere Client:

...

  • Create an SSH key pair on the management node (or use a key you previously created):
    Panel

    ssh-keygen -t rsa -f /etc/vcl/vcl.key -N '' -b 1024 -C 'VCL root account'

  • Log into the ESX host via SSH (password authentication should work) and create the directory:
    Panel

    ssh -o Batchmode=no vcl-esxi01 'mkdir /.ssh'

  • Copy the public key to the ESXi host:
    Panel

    scp -o Batchmode=no /etc/vcl/vclwinxp_blade.key.pub root@vclvcl-esxi01:/.ssh/authorized_keys

  • Test connecting making an SSH connection using the key:
    Panel

    ssh -i /etc/vcl/vcl.key root@vclvcl-esxi01

IMPORTANT: Under ESXi, the authorized_keys file is erased when the ESXi VM host is rebooted. Complete the following steps to make the authorized_keys file persistent:

  • Create a compressed tarball file containing the /.ssh directory:
    Panel

     
    tar -C / -czf "/ bootbank/vcl.tgz " "/ .ssh"

  • Edit the /bootbank/boot.cfg file and append ' --- vcl.tgz' to modules line as shown in the following example:
    Panel

    kernel=b.z
    kernelopt=
    modules=k.z — s.z — c.z — oem.tgz — license.tgz — m.z — state.tgz — vcl.tgz
    build=4.1.0-260247
    updated=2
    bootstate=0

VM host profile parameters:

...