Creating an SSH key pair

Create the SSH key

  • Why you need an SSH key: An SSH key is used to authenticate your computer against the machine hosting the OPU. You will need it if:
    • you want to access LOC through SSH (instead of Jupyter), or
    • You want to access your files through SFTP (GUI or not).

(If you already have an SSH key that is protected with a passphrase, you can skip the process of creating a new one and you can use the existing one instead.)

  1. Open Terminal (or Git Bash, if on Windows)
  2. Run the command ssh-keygen -t RSA -b 4096
  3. When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.
  4. At the prompt, type a secure passphrase (Don’t leave the passphrase empty!).
  5. Get your SSH public key: copy-paste the contents of the file ~/.ssh/ with the command: less ~/.ssh/

If the SSH key is refused
On some systems, the SSH key needs to be activated every time you launch a new terminal. It’s not the case on Ubuntu.

  • Start the ssh-agent by running the command: ssh-agent /bin/bash
  • Add the SSH key to the ssh-agent: ssh-add ~/.ssh/id_rsa
  • Enter the passphrase of your key