For security, by default ESXi 5 stops the SSH service after 1800 seconds since starting it. If user logins in within the 30 minutes windows, the session will be kept. To change the default value to meet your needs, you have to change the value of ‘UserVars.ESXiShellTimeOut‘ in the Advanced Settings.
Here is my example of changing the value to 60 seconds.
Before making the change, ensure both ESXi Shell and SSH service are not running.