Generating SSH Keys
Note: this guide is primarily for OSX. There will be slight variations for other platforms.
Step 1: Check for SSH keys
First, check for existing ssh keys on your computer. Open up Terminal and run:
cd ~/.ssh ls # Lists the files in your .ssh directory
Check to see if you have a file named either id_rsa.pub or id_dsa.pub. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, so you can skip to step 3.
Step 2: Generate a new SSH key
To generate a new SSH key, enter the code below. When asked to enter a file in which to save the key, just press enter for default settings.
ssh-keygen -t rsa -C "firstname.lastname@example.org" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] ssh-add id_rsa
Now you need to enter a passphrase. You should see something like this:
# Your identification has been saved in /Users/you/.ssh/id_rsa. # Your public key has been saved in /Users/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db email@example.com
Step 3: Add your SSH key to Penflip
Run the following code to copy the key to your clipboard (choose one corresponding to your operating system):
# Mac: pbcopy < ~/.ssh/id_rsa.pub # Windows: clip < ~/.ssh/id_rsa.pub # Linux: sudo apt-get install xclip # Downloads and installs xclip. xclip -sel clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Alternatively, using a text editor, you can open the ~/.ssh/id_rsa.pub file and copy the contents of the file manually.
Note: it's important to copy the key exactly without adding newlines or whitespace. The
pbcopy command makes it easy to perform this setup perfectly.
- Go to your Account
- Click Advanced in the top navigation
- Click Add SSH key
- Paste your key into the "Key" field (title should be auto-generated)
- Click "Add key"
Step 4: Test SSH
To make sure everything is working you'll now SSH to Penflip. Enter the following command:
ssh -T firstname.lastname@example.org
You may see an RSA key fingerprint warning. Don't worry, this is supposed to happen.
If everything worked, you now have SSH access to Penflip! You can access your projects via the command line. For SSH access URLs, see 'Project Settings' > 'Advanced' from any of your projects.