--- title: "Connect with an SSH key" description: "Choose an SSH key when you create an instance or a training cluster, then connect with ssh and the private key." content_type: "how-to" product: "ssh-keys" platform: "TIR" url: "/tir/ssh-keys/how-to/connect-with-an-ssh-key/" topic: ["ssh-keys"] relationships: {"requires":["/tir/ssh-keys/how-to/add-an-ssh-key/"]} --- # Connect with an SSH key Once a key is in your account, choose it when you create a resource, then connect with the private key that matches it. ## Before you begin - A key in your **SSH Keys** list; see [Add an SSH key](/tir/ssh-keys/how-to/add-an-ssh-key/). - The private key file on your computer. - A security group that opens port 22, attached to the instance, virtual machine, or training cluster. SSH connects through that port. ## Choose the key when you create a resource In the create form of an instance, a virtual machine, or a training cluster, **SSH Keys** lists your keys. Choose one or more. If the key you want is missing, add it from the link in the form, which keeps you on the page, then refresh the list. See [Create an instance](/tir/tir-instance/how-to/create-an-instance/) and [Create a Slurm Cluster](/tir/tir-slurm-cluster/how-to/create-a-slurm-cluster/). ## Connect If you made the key on your computer with `ssh-keygen`: ```bash ssh -i ~/.ssh/id_ed25519 root@ ``` If you created the key in the browser, first set permissions on the downloaded private key file: ```bash chmod 600 ``` Then connect: ```bash ssh -i root@ ``` - `` is the IP address of the instance or cluster. - `` is the path to your downloaded private key file. `chmod 600` makes the file readable only by you, which SSH needs before it will use a private key file. TIR instances and the login node of a Slurm Cluster use the user `root`. The user name can depend on the image the resource runs, so if your image's documentation names another user, use that one. For an instance's connection details, see [Connect to an instance over SSH](/tir/tir-instance/how-to/connect-to-an-instance-over-ssh/); for a Slurm Cluster, see [Connect to a cluster](/tir/tir-slurm-cluster/how-to/connect-to-a-cluster/).