PowerCLI: enable SSH and configure ESXi Firewall

From VI-Toolkit
Jump to: navigation, search

PowerCLI: Enable SSH and configure ESXi Firewall

author: Arne Fokkema

Description

By default nowadays a host is not supposed to have SSH enabled as you are supposed to manage your host via the exposed APIs. There are however times when it is really convenient to have SSH access. Instead of just opening SSH and disregarding or ignoring the warning this creates, Arne created a PowerCLI script to enable/disable SSH on need.

The script configures SSH to start automatically, it hides the Shell warning message and will then configure the ESXi firewall to allow the connection from a certain IP address.

Usage

Change the $cluster and $ip variables to accomodate your environment. Then copy the script to your PowerCLI session and run it.

$cluster = "<clusterName>"
$ip = "192.168.1.1"

Location

http://ict-freak.nl/2013/05/02/powercli-enable-ssh-and-configure-esxi-firewall/