Information
Disable Secure Shell (SSH) for each ESXi host to prevent remote access to the ESXi shell.
only enable if needed for troubleshooting or diagnostics.
*Rationale*
The ESXi shell, when enabled, can be accessed directly from the host console through the
DCUI or remotely using SSH. Remote access to the host should be limited to the vSphere
Client, remote command-line tools (vCLI/PowerCLI), and through the published APIs.
Under normal circumstances remote access to the host using SSH should be disabled.
Solution
Perform the following-1. From the vSphere web client select the host.
2. Select 'Manage' -> 'Security Profile'.
3. Scroll down to 'Services'.
4. Click 'Edit...'.
5. Select 'SSH'.
6. Click 'Stop'.
7. Change the Startup Policy 'to Start and Stop Manually'.Additionally, the following PowerCLI command will implement the recommended
configuration state-# Set SSH to start manually rather than automatic for all hosts
Get-VMHost | Get-VMHostService | Where { $_.key -eq 'TSM-SSH' } | Set-VMHostService - Policy Off
Default Value-The prescribed state is the default state.