Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Virtualization / VMware / Enable SSH on VMware ESXi Host

March 15, 2024

Enable SSH on VMware ESXi Host

Remote access to the command prompt (server console) via SSH is disabled by default on VMware ESXi hosts. So, when connecting to an ESXi host over SSH, you will get the error: ssh: connect to host 192.168.50.13 port 22: Connection refused. In this article, we’ll cover all the ways to enable SSH access on VMware ESXi hosts.

Contents:
  • Enable SSH Access via DCUI Console on ESXi
  • How to Enable SSH on ESXi from the vSphere Web Client?
  • Enabling SSH on VMware ESXi with PowerShell

Enable SSH Access via DCUI Console on ESXi

You can enable SSH on your VMware ESXi host through the server’s DCUI (Direct Console User Interface). For this:

  1. Press F2 on the DCUI logon screen and enter the root password; login VMware ESXi DCUI
  2. Go to System Customization -> Troubleshooting Options, select Enable SSH, and press Enter. enable ssh on esxi host via local console

Try to connect to your ESXi host remotely using any SSH client (I’m using the built-in Windows SSH client):

ssh [email protected]

connecting esxi host via ssh

After connecting to the server console, you may use ESXi shell commands to perform various maintenance or diagnostic tasks. For example:

  • Install updates on your ESXi host
  • Check and upgrade the VM hardware version
  • Force restart a virtual machine that is not responding
  • Recover an accidentally deleted VMFS datastore or expand it
  • Configure an SNMP agent on ESXi
  • Configure an iSCSI LUN on a VMware ESXi server or check if it is available
  • Reduce VMware virtual machine disk size

After you have done everything you wanted in the ESXi console, it is recommended to stop the SSH service

How to Enable SSH on ESXi from the vSphere Web Client?

You can enable SSH through the vSphere Client web interface.

If you are using a standalone ESXi host (or a free VMware Hypervisor), connect to its web interface: https://192.168.50.13/ui/#/host.

  1. Go to Manage -> Services;
  2. Select TSM-SSH in the list of services and click Start; enable TSM-SSH service
  3. By default, the SSH service on an ESXi host is started and stopped manually. You can configure the SSH service to start automatically by clicking Actions -> Policy -> Start and stop with host. start tsm-ssh automatically on esxi

To enable SSH on the ESXi host connected to vCenter:

  1. Find the host in the Inventory list;
  2. Go to Configure -> Services;
  3. Find the SSH service in the list and enable it by clicking Start. enable ssh using vsphere web client

Note that there is the Firewall tab in the host settings Here you can set a list of IP addresses that are allowed to connect to the ESXi host via SSH (the list is unlimited by default).

Enabling SSH on VMware ESXi with PowerShell

You can enable an SSH server on your ESXi host using PowerShell cmdlets from the VMware PowerCLI module. Suppose that the module is already installed on your computer (if not, install it using Install-Module -Name Vmware.PowerCLI command).

To connect to an ESXi host or a vCenter server, run the command below:

Connect-VIServer <vCenter_or_ESXi_host_FQDN>

If a self-signed certificate is used on your VMware vCenter server, run this command before trying to connect to it:

Set-PowerCLIConfiguration -Scope AllUsers -InvalidCertificateAction Warn

List all ESXi hosts connected to this vCenter server and the states of the SSH service on them:

Get-VMHost| Get-VMHostService | Where Key -EQ "TSM-SSH" | Select VMHost, Key, Running, Policy

check ssh service on esxi hosts via powershell

To start SSH on a specific ESXi host, run the following command:

Get-VMHostService -VMHost mun-esxi1 | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService

Start-VMHostService: enable ssh using powercli

If the LockDown mode is enabled on the ESXi host, you can disable it as follows:

(Get-VMHost mun-esxi1 |get-view).ExitLockdownMode()

To enable the LockDown mode:

(Get-VMHost mun-esxi1 |get-view).EnterLockdownMode()

To stop the SSH service on all hosts at once, use the PowerShell command below:

Get-VMHost | Foreach { Stop-VMHostService -confirm:$false -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )}

To suppress SSH login warnings on all ESXi hosts:

Get-VMHost | Get-AdvancedSetting UserVars.SuppressShellWarning |Set-AdvancedSetting -Value 1

Remember to close your PowerShell session correctly:

Disconnect-VIServer * -confirm:$false

1 comment
2
Facebook Twitter Google + Pinterest
PowerShellVMware
previous post
Find Windows OS Versions and Builds in Active Directory
next post
How to Fix the ‘Too Many Open Files’ Error in Linux

Related Reading

Configuring iSCSI Datastore (LUN) on VMware ESXi

March 15, 2024

How to Fix ‘An Operating System Wasn’t Found’...

August 24, 2023

Adding Drivers into VMWare ESXi Installation Image

March 13, 2024

How to Install Free VMware Hypervisor (ESXi)

March 17, 2024

Windows Cannot Find the Microsoft Software License Terms

April 19, 2023

How to Access VMFS Datastore from Linux, Windows,...

March 11, 2024

Using iPerf to Test Network Speed and Bandwidth

March 12, 2024

Unmounting an NFS Datastore from VMware ESXi

March 12, 2024

1 comment

Lane February 19, 2023 - 6:08 am

Super Helpful, Was the only website i could find for help with our ESXi problems.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Install and Manage Windows Updates with PowerShell (PSWindowsUpdate)
  • How to Download Offline Installer (APPX/MSIX) for Microsoft Store App
  • Fix: Remote Desktop Licensing Mode is not Configured
  • How to Delete Old User Profiles in Windows
  • Configuring Port Forwarding in Windows
  • How to Install Remote Server Administration Tools (RSAT) on Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top