Move SSHkeys.md to working-offline/SSHkeys.md

loren authored
revision 9791e78ce3b8ee42a70a6aeb4c09b49810faf507
Contents
About.txt
GeneralOverview.txt
ProjectTypes.txt
versions.md
SSHkeys.md
writing/Markdown.txt
writing/syntax-highlighting.txt
writing/keyboard-shortcuts.md
working-offline/WorkingOffline.txt
working-offline/SSHkeys.md
SSHkeys
Deleted file
working-offline/SSHkeys
# 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:

```bash
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 "your_email@example.com"
# 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 your_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.

1. Go to your [Account](https://www.penflip.com/profile)
2. Click [Advanced](https://www.penflip.com/profile/keys) in the top navigation
3. Click [Add SSH key](https://www.penflip.com/profile/keys/new)
4. Paste your key into the "Key" field (title should be auto-generated)
5. Click "Add key"

That's it!

### Step 4: Test SSH

To make sure everything is working you'll now SSH to Penflip. Enter the following command:

```
ssh -T git@penflip.com
```

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.