# SSH Mode

***

### SSH Setup for Remote Cluster Creation <a href="#ssh-setup-for-remote-cluster-creation" id="ssh-setup-for-remote-cluster-creation"></a>

The Platform9 Managed Kubernetes CLI provides an easy way to prepare nodes for creating [BareOS](https://docs.platform9.com/managed-kubernetes/clusters/on-premise-bare-os) Kubernetes clusters.

The CLI may be utilized to configure and deploy Kubernetes clusters as a remote kubernetes management tool. To do this you require a CentOS or Ubuntu server to download and install the CLI on. Then you are able to use the CLI to prepare your machines with all pre-requisites, attach them to the SaaS Management Plane and then use the Platform9 web app create a cluster.

#### SSH Setup for Remote Nodes <a href="#ssh-setup-for-remote-nodes" id="ssh-setup-for-remote-nodes"></a>

If you want to use the CLI to create a PMK cluster on remote nodes, then you need to setup ssh based authentication on these nodes with either a password or ssh key.

If creating a cluster with multiple nodes, you need the following configured across all the nodes first:

* **Same username** - The CLI requires that you specify the username as a parameter during cluster creation.
* **Same ssh password or common ssh key** - The CLI requires that you specify either of these as a parameter during cluster creation.

Follow these instructions to create an ssh key-pair and populate the public key on all your nodes.

* Ensure you have created a user account with the same userid on each node.
* Create a new ssh key pair (or skip this instruction if you are using an existing key pair).

```
ssh-keygen -t rsa -b 2048
```

* Copy over the public key portion of the key pair to all the remote nodes. ssh-copy-id is a simple utility that lets you do this without the copy-paste overhead. When you use ssh-copy-id, the public key will be added to the node’s authorized\_keys file for the specified user. Make sure this is the common user account you created on all the nodes.

```
ssh-copy-id [-i <path to ssh public key>] <user>@<remote ip>
```

* Test connectivity with the key

```
ssh [-i <path to ssh private key>] <user>@<remote ip>
```

Thats it! Now you are all set to create a [PMK cluster on these remote nodes](https://docs.platform9.com/managed-kubernetes/pmk-cli/commands/cli-prep-node).
