To create an SSH key pair:
- Open a nanoHUB Jupyter terminal.
- Change the working directory to the .ssh (hidden) directory:
cd .ssh
- List the files in the directory:
ls
- If there is already a file named “id_rsa.pub”, then an SSH key pair has already been set up. The contents of this file are your public SSH key.
- If there is no file named "id_rsa.pub" (or if you want to create a new .ssh key), enter the following on the command line while working in the .ssh directory:
ssh-keygen -t rsa -b 4096 -C "Used with user name’s nanoHUB account"
- You can update the comment within the quotes as you like.
- When prompted for the directory, press Enter to use the default .ssh directory
- When prompted for a passphrase, you can press Enter to bypass using a passphrase. It is acceptable to not use a passphrase, and the key is still pretty safe.
- Two files will be generated:
- .ssh/id_rsa
- .ssh/id_rsa.pub
- You will also see a “key fingerprint” and a “random art image”. You do not need to do anything with these.
- Copy the contents of the id_rsa.pub file to paste elsewhere (for example, in your private GitHub repository.)