Configuring SSH Access to Kubernetes Nodes

When setting up an on-premises Kubernetes cluster, you need access to the host machines to run the commands that install Kubernetes on each node. Once the cluster is up and running, you typically do not need to log in directly to the nodes, except for occasional maintenance tasks, such as applying operating system updates or troubleshooting hardware or network issues.

You can access your machines in one of the following ways:

  • SSH (Secure Shell) —The recommended method for remote access. It is lightweight, reliable, and works entirely from the command line without requiring a graphical user interface on the node.

  • Console access —Useful when SSH is not configured yet or when the network is unavailable. Every virtualization platform (such as Hyper-V, vSphere, VMware Workstation, or VirtualBox) provides a built-in console that allows you to interact directly with the virtual machine. On bare-metal servers, this can be a physical console or a remote management interface, such as IPMI, iDRAC, or iLO.

  • RDP —Supported if the host machine runs a graphical Linux desktop, but not recommended for server environments, as it adds unnecessary overhead and is not typically available by default.

For the purpose of setting up a Kubernetes cluster on virtual machines, it may be sufficient to use the console access built into Hyper-V, VMware, or VirtualBox, since you only need to run a few commands on each node to install a K3s Kubernetes cluster. However, console access is typically available only to administrators with direct access to the host machine. SSH is a universal approach that works across all platforms and is better suited for ongoing management, automation, and remote access. This topic describes how to set up SSH access to your Kubernetes nodes.

Configuring SSH on a Host Machine

Make sure that the SSH server is installed and running on each node — that is, on every Linux machine that will host a part of your Kubernetes cluster. On a Debian-based system (such as Ubuntu), you can install it with the following commands:

sudo apt update sudo apt install -y openssh-server

If UFW (Uncomplicated Firewall) is enabled on your system, make sure it allows incoming SSH connections. Otherwise, you might lose remote access after enabling the firewall. To open the SSH port (22/tcp), run the following command:

sudo ufw allow ssh

You can verify that the rule was applied using this command:

sudo ufw status

Configuring SSH on a Client Machine

To access the nodes from your local machine — whether you’re using Windows, Linux, or macOS — make sure an SSH client is installed.

  • On Linux and macOS, the ssh command is usually available by default.

  • On Windows 10 and later, OpenSSH is included and can be used directly from PowerShell or Command Prompt.

  • On older versions of Windows, you can install a third-party client, such as PuTTY .

Once an SSH client is available, connect to a node using the following format:

ssh <username>@<host>

Replace <username> with the user account on the node, and <host> with either the node’s hostname or its IP address.

What's Next?

Advanced SSH Settings