In order to access an ESXi host system using a SSH client there is a requirement to connect to the remote host. By default, the ESXi host system does not enable SSH connections and therefore there is a requirement to enable access to an ESXi host system to use SSH. This can be performed from the vSphere Web Client by performing the following:
1) Select the ESXi host system you require to enable SSH.
2) Select Manage > Security Profile > Services and select Edit.
3) Select the SSH service and select Start.
I have previously written about enabling the SSH service on multiple ESXi host systems using PowerCLI at https://deangrant.wordpress.com/2014/08/19/powercli-starting-and-stopping-the-ssh-service-on-multiple-esxi-hosts/.
By default the startup policy will be configured to be stop and start manually, on restart of the ESXi host system the service will not be started on startup. To secure the SSH connectivity further you may configure a timeout value for each connection. In order to configure a timeout value we will need to modify the advanced settings of the ESXi host system for the value ‘UserVars.ESXiShellTimeout’ which can be performed in the vSphere Web Client as follows:
1) Select the ESXi host system you require to configure a SSH timeout value
2) Select Manage > Advanced System Settings
3) Browse to the value ‘UserVars.ESXiShellTimeout’ and select Edit.
The value in seconds can be set from 0 (no timeout value) to 86,400 seconds. Alternatively, you can use PowerCLI and the Set-AdvancedSetting cmdlet to configure this value as below to configure a timeout value of one hour.
Get-VMHost esxi1.dean.local | Get-AdvancedSetting -Name "UserVars.ESXiShellTimeOut" | Set-AdvancedSetting -Value "3600" -Confirm:$False