VMware

VMware ESXi – How to enable SSH Connectivity.

To enable SSH on VMware ESXi you need to enter an ‘unsupported’ mode.  For background information on this mode and why the Service Console (SC) that you are probably familiar with from ESX (ie: non ESXi) is by default missing see my other article here.

Enabling SSH is straight forward -  just follow these 8 basic steps:

Step 1. Connect to ESXi console and press the Alt+F1 key combination.

VMware ESXi SSH

Step 2. Type ‘unsupported’ and then press <Enter>. Note that nothing will appear on the screen whilst you type this.

VMware ESXi SSH 

Step 3.  When prompted enter in the ‘Root’ password and press <Enter>.

VMware ESXi SSH

Step 4. You will now be presented with a prompt on the console. From this prompt type ‘vi /etc/inetd.conf’

VMware ESXi SSH

Step 5. vi (the file editor) has now opened the inetd.conf file.  Using the direction arrows scroll through the lines until you reach the line that has ‘#ssh’ and remove the hash (ie: #).  This is effectively un-commenting this line so that the ssh service can be started.

VMware ESXi SSH

Step 6. Now that you have made this minor file you want to save this change and exit out of the editor (vi).  To do this press the ESC key (to put vi back into Command Mode) and then type ‘:wq’  *Note: If you want to exit without saving any changes to the file then just press the ESC key (Command Mode) and then type ‘:q!’.

Step 7.  With the SSH service now un-commented from this file we want to restart the ‘inetd’ process so that it starts again and reads in the newly altered file which will tell it to start the SSH service. 

This is the part of the enabling SSH that has changed between minor revisions of ESXi as pre-ESXi Update 2 you would run the command ‘/sbin/services.sh restart’  though for any release of ESXi Update 2 and more recent we have effectively kill the ‘inetd’ process to make it automatically restart again.

To do this we first need to find out what the process ID is of ‘inetd’.  From the console command prompt type ‘ps | grep inetd’ which will give you a result similar to the following.

VMware ESXi SSH

Step 8. From running this command we can see that the process ID for ‘inetd’ is 1331.  Now type ‘kill –HUP <insert process ID>’ where <insert process ID> is the process ID seen in the previous step.

Finished!  Congratulations – you should now be able to connect to your ESXi server via a SSH client such as Putty.

 

Technorati Tags: ,,,,,
Share
S

Simon Seagrave

OpenShift Virtualization · Red Hat

Thirty years of virtualization, one stubborn home lab, and a growing AI rabbit hole. I test it locally first.

More posts

18 comments

Join the thread
  1. mattywhi Mar 15, 2009

    Is this how you can also enable SNMP for an ESX host?

    Reply
    1. toody May 13, 2009

      ESX supports snmp, the free edition of ESXi does not (not even unsupported). u need to get a licensed ESXi for this to work

      Reply
  2. Trabalash Apr 2, 2009

    “q not implemented”. Editing the file not working at all.

    Reply
    1. Kiwi Si Apr 2, 2009

      Hi Trabalash,

      The command youn should be typing in is ‘:wq’ not just ‘q’ on its own.

      Cheers,

      Si

      Reply
  3. Pending projects « The Radinator Sep 14, 2009

    […] future reference to enable SSH in ESXi Categories: Linux, Projects, VMWare Komentar (0) Lacak Balik (0) […]

    Reply
  4. anonymous Dec 25, 2009

    take a look here http://salawank.performance-weaver.com for snmp

    Reply
  5. Uese Veeam FastSCP For Easy ESXi File Management | VM /ETC Feb 24, 2010

    […] doesn’t have a Service Console like ESX. Therefore, you can’t SSH to the server without entering unsupported mode. That process may be a hassle if all you need to do is modify VM configuration files. Of ourse, you […]

    Reply
  6. VMware ESXi – Where’s the Service Console & SSH and how to enable similar functionality? | TechHead.co.uk Mar 20, 2010

    […] my article here for how to enable SSH on VMware ESXi. Technorati Tags: VMware,ESXi,Service […]

    Reply
  7. ESXi 4 ?? ssh ???? « 00086 Jun 10, 2010
    Reply
  8. Ron Aug 2, 2010

    A question – how to get back to welcome screen? “exit” doesn’t do the job.

    Reply
  9. Ron Aug 6, 2010

    Alt+F2, to answer my own question.

    And the SSH hack does not work for v4 I believe.

    Reply
  10. soon Aug 6, 2010

    SSH hack WAS possible with esxi 4.0 but the ssh functionality disappeared with the upgrade to 4.1.

    after a new installation of 4.1 I’ve tried this hack again, but it’s not working anymore.

    is there an other way?

    Reply
  11. soon Aug 6, 2010

    solution in 4.1:
    ESXI Console
    F2
    login
    navigate to: Troubleshoot Mode Option

    (self explaining)

    have fun

    Reply
  12. VMware ESXi – How to enable SSH Connectivity | Angel's Place Sep 28, 2010

    […] how to do it here. This entry was posted in Uncategorized and tagged connect, enable, ESXi, missing, SSH, VMware. […]

    Reply
  13. When trying to copy a virtual disk in VMware vSphere client, I get an errror. Nov 28, 2010

    […] May 20, 2010 4:57 am Joe The best way to do this, is to enable SSH access. You may then use the normal compliment of CLI utilities, such as vmkfstools, or simply copy the […]

    Reply
  14. Ben Northway Dec 21, 2010

    Worked perfectly! Thank you.

    Reply
  15. Alex May 3, 2011

    I used vClient: ESXi(4.1) Host – configuration – Software – Security profile – properties – SSH should be running. You can use putty!

    Reply
  16. When trying to copy a virtual disk in VMware vSphere client, I get an errror – Admins Goodies Aug 20, 2011

    […] best way to do this, is to enable SSH access. You may then use the normal compliment of CLI utilities, such as vmkfstools, or simply copy the […]

    Reply

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.