# PMK CLI Remote Ssh

The Platform9 Managed Kubernetes CLI provides an easy way to prepare nodes for creating [BareOS](https://github.com/platform9/pcd-docs-gitbook/blob/main/kubernetes/bareos-what-is-bareos/README.md) 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

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).

{% tabs %}
{% tab title="Bash" %}

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

{% endtab %}
{% endtabs %}

* 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.

{% tabs %}
{% tab title="Bash" %}

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

{% endtab %}
{% endtabs %}

* Test connectivity with the key

{% tabs %}
{% tab title="Bash" %}

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

{% endtab %}
{% endtabs %}

Thats it! Now you are all set to [create a PMK cluster on these remote nodes](https://github.com/platform9/pcd-docs-gitbook/blob/main/kubernetes/cli-prep-node/README.md#prepare--attach-nodes-to-platform9).
