VMware Sphere is all well and good until you have ten or more ESX servers that you need to manage. Then it can be quite a drag to use the GUI to log in to each host and take care of business. In addition, VMware Sphere doesn’t yet support Linux… so if you’re a Linux guy (or gal) you’re forced to keep a Windows machine around and running just to do basic administration.
But here’s a secret: since ESX has a unix-like base operating system, you can turn on SSH access with little trouble. Once it’s on, you can do everyday jobs without your fingers leaving the keyboard – or even scripting using authorized keys if you like.
For this trick, you need to have physical access to the VMware ESX host machine and its root password. Note: A root password is not set by default when you install on a new box.
The screen on the physical box looks something like this:
Note: Write down the IP address on the screen (it’s censored in my picture). You’ll need it in order to SSH into the box later.
If you need to set a root password now, choose <F2> to customize your system and set the password now. Once the password is set, we need to turn on “Tech Support Mode”. To do so, press CTRL-ALT-F1 on the keyboard. The screen displays something like the following:
ESX 4.0 http://www.VMware.com Copyright (c) 2007-2009 VMware, Inc.
Type the word “unsupported” (without the quotes, of course). The letters won’t echo back to you as you type. Once you’ve typed it successfully, a password prompt appears. Go ahead and type in your root password here. You’ll get a warning screen about “Tech Support Mode” from the VMware folks:
You have activated Tech Support Mode.
The time and date of this activation have been sent to the system logs. Tech Support Mode is not supported unless used in consultation with VMware Tech Support.
VMware offers supported, powerful system administration tools. Please see www.VMware.com/go/sysadmintools for details.
Tech Support Mode may be disabled by an administrative user. Disabling requires a reboot of the system. Please consult the ESXi Configuration Guide for additional important information.
The hard part is over! Now that you’re in, it’s time to enable SSH. There’s no need to install anything – all you have to do is update a configuration file. Use VI to open /etc/inetd.conf:
# vi /etc/inetd.conf
Search for the term “ssh”. If you’re unfamiliar with VI, just type the next line followed by a return:
/ssh
Follow that by a carriage return and you should land on a a line that looks much like this:
#ssh stream tcp6 nowait root /sbin/dropbearmulti dropbear ++min=0,swap,group=shell -i -K60
The hash mark at the beginning of this line does not indicate that this is a command at the command line. In this case, it’s a comment symbol inside a configuration file. Go ahead and remove the hash mark at the beginning of the line (#) so this line will be active the next time the machine is rebooted:
ssh stream tcp6 nowait root /sbin/dropbearmulti dropbear ++min=0,swap,group=shell -i -K60
That’s it! Now save and close the file:
:wq
Reboot the box. When the box is back up, you can now login into it from any other SSH-capable box on your network:
# ssh root@xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the IP address you noted earlier.
Coming soon: How to do run basic commands on VMs using SSH and VMware commands!
