# How do you create a new ssh key?

**URL:** <https://ask.cyberinfrastructure.org/t/how-do-you-create-a-new-ssh-key/1370>\
**Category:** University of Missouri - Columbia\
**Created:** [May 18, 2020, 6:32pm UTC](https://ask.cyberinfrastructure.org/t/how-do-you-create-a-new-ssh-key/1370 "2020-05-18T18:32:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjmfg8](https://ask.cyberinfrastructure.org/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@bjmfg8](https://ask.cyberinfrastructure.org/u/bjmfg8)\
**Post date:** [May 18, 2020, 6:32pm UTC](https://ask.cyberinfrastructure.org/t/how-do-you-create-a-new-ssh-key/1370/1 "2020-05-18T18:32:02Z")

</div>

# Generate A SSH Key Pair

> SSH Key pairs are a simple and secure way to access Lewis. A SSH key pair contains  
> a private key and a public key. You will keep your private key to on your computer  
> or a USB key.

## Step 1

On the computer you want to use to access Lewis, open your terminal app.

Then type the following command:

```bash
ssh-keygen

```

When prompted press enter to save the key in the default location

(`/home/<username>/.ssh/id_rsa`) then enter a strong passphrase (required) twice.

After you generate your key you will need to display the _public_ key

and include it in the Account Request Form. Type the command:

```bash
cat ~/.ssh/id_rsa.pub

```

The output will be a unique string of random characters similar to this:

```bash
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7iKBE2qsnnR+mguxvvKNyj/IJchBjba4QD39BGMCC
vytPxFOoN9h2WbeIg1cUSpv7sb6STGcrCXnSrthM4fuasFM/KXELnJobq0JBEd6pld72jhBVHzObomrs
ktGSThO3JqSgE2O0elxcfT/0dSn/6t+GY/HvkcgdFnenfW3oHTOdAyWgHXe/0aWSuq60DhLfJGp8mM1N
Ixjagd9s/OLByOSV7GxwUCNl+OD/CsaLkGgrB6jonf01cjfaFYh4iYcBX5s7lZuBCSpFY1+KqeE8ZZ8k
qDdMqgYOmw2SxFpST1iaC9wmL9N4J4Xm <your_user_name_here>@<your_computer_name_here>

```

We recommend that you copy your SSH key pair to a USB drive so you can log in to

Lewis from more than one computer. Replace the the path below in the example to

the actual path to your USB drive:

```bash
mkdir /some/path/to/usb_drive/ssh_key_backup/
cp ~/.ssh/id_rsa* /some/path/to/usb_drive/ssh_key_backup/
ls /some/path/to/usb_drive/ssh_key_backup/

```
