PowerCLI: enable SSH and configure ESXi Firewall

From VI-Toolkit
Revision as of 19:13, 29 July 2013 by Wila (talk | contribs) (Oops, not perl, but powerCLI)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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/