# SSH

Things to do via SSH on the ESXi host


# Add SSH key authentication

  • Log in
  • Navigate to /etc/ssh
  • Create a folder for your user /etc/ssh/keys-<username>/
  • Create the authorized_keys file and populate it with your SSH key.
echo "<key>" > /etc/ssh/keys-<username>/authorized_keys

# Ensure that the file permissions are correct

chmod 1600 /etc/ssh/keys-<username>/authorized_keys

# Check running processes

ps -Tcst

# Reset locked account

To reset a locked account manually, you will need direct access to the ESXi console

# Enable ESXi shell

  1. Press F2 at the login prompt
  2. Select Troubleshooting Option
  3. Select Enable ESXi Shell
  4. Once enabled, press the key combination ALT+F1

TIP

You can return back to the GUI using ALT+F2

# Check the locked account

Once you are logged in to the console, run:

pam_tally2 --user root

# Reset the locked account

Run:

pam_tally2 --user root --reset

# Manage Network Routes

# List Routes

esxcli network ip route ipv4 list

# Add a New Route

esxcli network ip route ipv4 add --gateway <Gateway IP> --network 192.168.0.0/16

# Remove a Route

esxcli network ip route ipv4 remove -n 192.168.0.0/16 -g <Gateway IP>

# Manage NFS Shares

# List Shares

esxcli storage nfs list

# Remove Share

esxcli storage nfs remove --volume-name=<NFS Share>
Last Updated: 2021/10/31 12:43+00:00