Happy New Year and welcome to this ITBOD Brain Byte post where I will quickly cover how to connect to a vCenter or ESXi host via SSH or SFTP using two popular clients, PuTTY and WinSCP.
This Brain Byte come about following on from previous posts where I have repeated steps such as how to SSH.., so rather than teach experienced admins how to suck eggs it was easier for both me to create this as reusable content and the reader to following the how on this if needed.
What is SSH & SFTP?
The Secure Shell (SSH) is a protocol that allows authentication and encrypted data communications between two systems over Transmission Control Protocol (TCP) port 22 & can also create secure tunnels for applications.
The SSH File Transfer Protocol (SFTP) is the same protocol/port but enables secure server to server file transfers and is a replacement for the insecure legacy FTP protocol.
Enable & Disable SSH - vCenter
vCenter Server Appliance Management Interface (VAMI)
You can connect to the VAMI console via link that specifies port 5480
Then login as root and follow numbered steps:
vCenter Direct Console User Interface (DCUI)
The DCUI can be accessed physically or via KVM/iLO type access. If your in a nested environment access is gained by opening a console window.
Enable & Disable SSH - ESXi Host
ESXi host via vCenter vSphere Client
You can connect to the main vCenter Web Client via link with VCs Fully Qualified Domain Name or IP.
Then login with account that has admin access and follow numbered steps:
ESXi host direct via vSphere Client
You can connect to the host directly also to enable SSH.
ESXi Direct Console User Interface (DCUI)
Finally as with the VC you can also access the hosts DCUI in the same manner.
Connect via SSH using Putty
You can download PuTTY from the following location as installer package or as stand-alone putty.exe:
1: Enter Hostname and ensure SSH is selected
2: Click Open
3: Enter root Username/Password
Connect via SFTP using WinSCP
Because SFTP runs over SSH you need to also have SSH enabled to allow you to connect to transfer files. If you have skipped straight to this point, just follow the steps on “Enable & Disable SSH” for vCenter/ESXi above.
You can download WinSCP from the following location as installer package or as stand-alone version: https://winscp.net
1: The left hand pane is your local drive
2: The right hand pane lists files on the system you are connecting too.
3: To connect to vCenter/ESXi host Click "Session > New Session..”
4: Enter Hostname/Username/Password and click Login.
5: Once connected, you can browse the filesystem and right click for options menu, if you just need to grab something quickly you can also drag and drop files/folders between panes.
It’s important you disable SSH on your VMware hosts and appliances when you no longer need to use it, this is not only a best practice but will decrease security risks that it can pose within your environments and systems.
More Info on SSH & SFTP
Alternative SSH & SFTP Apps