To prevent intruders from using an idle session, set timeouts for the ESXi Shell and vSphere Client.

ESXi Shell Timeout

For the ESXi Shell, you can set the following timeouts from the vSphere Client and from the Direct Console User Interface (DCUI).
Availability Timeout

The availability timeout setting is the amount of time that can elapse before you must log in after the ESXi Shell is enabled. After the timeout period, the service is disabled and users are not allowed to log in.

Idle Timeout

The idle timeout is the amount of time that can elapse before the user is logged out of an idle interactive sessions. Changes to the idle timeout apply the next time a user logs in to the ESXi Shell. Changes do not affect existing sessions.

vSphere Client Timeout

vSphere Client sessions end after 120 minutes by default. To change the default:
  1. In the vSphere Client, navigate to the vCenter Server instance.
  2. Select the Configure tab, and under Settings, select General.
  3. Click Edit.
  4. Select Timeout settings.
  5. Enter your choices and click Save.