From 03448979f9cb459304365a9d660ed660baf48926 Mon Sep 17 00:00:00 2001 From: tekkub Date: Thu, 3 Sep 2009 21:34:28 -0600 Subject: Add linux key setup guide --- _posts/2009-06-15-linux-key-setup.textile | 67 ++++++++++++++++++++++++++++ _posts/2009-06-15-mac-key-setup.textile | 2 +- _posts/2009-06-15-msysgit-key-setup.textile | 2 +- _posts/2009-08-14-key-setup-redirect.textile | 6 ++- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 _posts/2009-06-15-linux-key-setup.textile diff --git a/_posts/2009-06-15-linux-key-setup.textile b/_posts/2009-06-15-linux-key-setup.textile new file mode 100644 index 0000000..b69d889 --- /dev/null +++ b/_posts/2009-06-15-linux-key-setup.textile @@ -0,0 +1,67 @@ +--- +layout: default +title: Generating SSH keys (Linux) +description: Setting up SSH keys on Linux +categories: linux setup +main_category: setup +--- + +This guide will step you through the process of generating a keypair on linux and uploading it to GitHub. We use Ubuntu and bash in this guide, command may vary depending on your linux flavor and shell. + +Generating an SSH key on linux is a fairly straightforward process. First and foremost, open up a "terminal":https://help.ubuntu.com/community/UsingTheTerminal. + +h2. Backup and remove existing keys + +Unless this is your first time setting up ssh or git on your computer, you should double check that keys do not already exist. If they do you can either use the existing key(s) or remove them. In either case, you should make a backup of the keys. + +
$ cd ~/.ssh
+$ ls
+config                id_dsa.pub
+id_dsa                known_hosts
+$ cd ..
+$ mkdir ssh_key_backup
+$ cp .ssh/id_rsa* ssh_key_backup
+$ rm .ssh/id_rsa*
+ +Here we have an existing keypair, @id_rsa@ and @id_rsa.pub@, which we've copied into @~/ssh_key_backup@ before removing. By default, ssh will use keys in @~/.ssh@ that are named @id_rsa@, @id_dsa@ or @identity@. + +h2. Generating a key + +p(. _If you have an existing keypair you wish to use, you can skip this step._ + +Now that we're certain ssh won't use an existing key, it's time to generate a new keypair. Lets make an RSA keypair: + +
$ ssh-keygen -t rsa -c "tekkub@gmail.com"
+Generating public/private rsa key pair.
+Enter file in which to save the key (/Users/tekkub/.ssh/id_rsa):
+Enter passphrase (empty for no passphrase):
+Enter same passphrase again:
+Your identification has been saved in /Users/tekkub/.ssh/id_rsa.
+Your public key has been saved in /Users/tekkub/.ssh/id_rsa.pub.
+The key fingerprint is:
+01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db tekkub@gmail.com
+ +At the first prompt you can just hit enter to generate the key with the default name. *You should use a good passphrase with your key.* See "Working with SSH key passphrases":/working-with-key-passphrases for more details on why you should use a passphrase and how to avoid re-entering it every time you use your key. + +p(. *Note:* If you don't use the default key names, or store your keys in a different path, you may need to run @ssh-add path/to/my_key@ so that ssh knows where to find your key. + +h2. Adding the key to your GitHub account + +Now launch your browser and open the "account page":https://github.com/account. In the "SSH Public Keys" section click "add another public key", then paste your public key into the "key" field. If you leave the title blank the key comment (your email) will be used for the title. + +Make sure you use the public key (@id_rsa.pub@ in our example), and do not add any newlines or whitespace inside the key. To ensure you copy the key correctly, you can copy the key directly into the clipboard from the terminal using "xclip":http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/: + +
$ sudo apt-get install xclip
+$ cat ~/id_rsa.pub | xclip
+ +!/images/add_key.png! + +h2. Testing things out + +Testing if our new key works is simple: + +
$ ssh git@github.com
+Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access.
+Connection to github.com closed.
+ +If you do not get the "successfully authenticated" message, check out the "troubleshooting guide":http://github.com/guides/addressing-authentication-problems-with-ssh. \ No newline at end of file diff --git a/_posts/2009-06-15-mac-key-setup.textile b/_posts/2009-06-15-mac-key-setup.textile index ad19636..6e04a18 100644 --- a/_posts/2009-06-15-mac-key-setup.textile +++ b/_posts/2009-06-15-mac-key-setup.textile @@ -12,7 +12,7 @@ Generating an SSH key on OSX is a fairly straightforward process. First and for h2. Backup and remove existing keys -Unless this is your first time setting up ssh or git on your computer, you should doublecheck that keys do not already exist. If they do you can either use the existing key(s) or remove them. In either case, you should make a backup of the keys. +Unless this is your first time setting up ssh or git on your computer, you should double check that keys do not already exist. If they do you can either use the existing key(s) or remove them. In either case, you should make a backup of the keys.
$ cd ~/.ssh
 $ ls
diff --git a/_posts/2009-06-15-msysgit-key-setup.textile b/_posts/2009-06-15-msysgit-key-setup.textile
index bd371b1..b630d41 100644
--- a/_posts/2009-06-15-msysgit-key-setup.textile
+++ b/_posts/2009-06-15-msysgit-key-setup.textile
@@ -12,7 +12,7 @@ Generating an SSH key with msysgit is a fairly straightforward process.  First a
 
 h2. Backup and remove existing keys
 
-Unless this is your first time installing msys on your computer, you should doublecheck that keys do not already exist.  If they do you can either use the existing key(s) or remove them.  In either case, you should make a backup of the keys.
+Unless this is your first time installing msys on your computer, you should double check that keys do not already exist.  If they do you can either use the existing key(s) or remove them.  In either case, you should make a backup of the keys.
 
 
$ cd ~/.ssh
 $ ls
diff --git a/_posts/2009-08-14-key-setup-redirect.textile b/_posts/2009-08-14-key-setup-redirect.textile
index 7c2c2ae..d760f3b 100644
--- a/_posts/2009-08-14-key-setup-redirect.textile
+++ b/_posts/2009-08-14-key-setup-redirect.textile
@@ -5,10 +5,12 @@ title: Generating SSH keys
 
 Attempting to redirect to the guide for your OS.  If the redirect fails, pick your OS:
 
-* "Mac":msysgit-key-setup
-* "Windows":mac-key-setup
+* "Windows":msysgit-key-setup
+* "Mac":mac-key-setup
+* "Linux":mac-key-setup
 
 
\ No newline at end of file
-- 
cgit v1.3.1


From 5165e698d3e15cf840cc906faf1d3f4c1815bdbc Mon Sep 17 00:00:00 2001
From: tekkub 
Date: Thu, 3 Sep 2009 21:44:06 -0600
Subject: Don't litter the Setup category with each OS key guide, use the
 redirector instead

---
 _posts/2009-06-15-key-setup-redirect.textile | 18 ++++++++++++++++++
 _posts/2009-06-15-linux-key-setup.textile    |  2 +-
 _posts/2009-06-15-mac-key-setup.textile      |  2 +-
 _posts/2009-06-15-msysgit-key-setup.textile  |  2 +-
 _posts/2009-08-14-key-setup-redirect.textile | 16 ----------------
 5 files changed, 21 insertions(+), 19 deletions(-)
 create mode 100644 _posts/2009-06-15-key-setup-redirect.textile
 delete mode 100644 _posts/2009-08-14-key-setup-redirect.textile

diff --git a/_posts/2009-06-15-key-setup-redirect.textile b/_posts/2009-06-15-key-setup-redirect.textile
new file mode 100644
index 0000000..adb6b36
--- /dev/null
+++ b/_posts/2009-06-15-key-setup-redirect.textile
@@ -0,0 +1,18 @@
+---
+layout: default
+title: Generating SSH keys
+description: How to generate SSH keys and add them to GitHub
+categories: setup
+---
+
+Attempting to redirect to the guide for your OS.  If the redirect fails, pick your OS:
+
+* "Windows":msysgit-key-setup
+* "Mac":mac-key-setup
+* "Linux":mac-key-setup
+
+
\ No newline at end of file
diff --git a/_posts/2009-06-15-linux-key-setup.textile b/_posts/2009-06-15-linux-key-setup.textile
index b69d889..886162b 100644
--- a/_posts/2009-06-15-linux-key-setup.textile
+++ b/_posts/2009-06-15-linux-key-setup.textile
@@ -2,7 +2,7 @@
 layout: default
 title: Generating SSH keys (Linux)
 description: Setting up SSH keys on Linux
-categories: linux setup
+categories: linux
 main_category: setup
 ---
 
diff --git a/_posts/2009-06-15-mac-key-setup.textile b/_posts/2009-06-15-mac-key-setup.textile
index 6e04a18..db3de92 100644
--- a/_posts/2009-06-15-mac-key-setup.textile
+++ b/_posts/2009-06-15-mac-key-setup.textile
@@ -2,7 +2,7 @@
 layout: default
 title: Generating SSH keys (OSX)
 description: Setting up SSH keys on Mac OSX
-categories: mac setup
+categories: mac
 main_category: setup
 ---
 
diff --git a/_posts/2009-06-15-msysgit-key-setup.textile b/_posts/2009-06-15-msysgit-key-setup.textile
index b630d41..47beb43 100644
--- a/_posts/2009-06-15-msysgit-key-setup.textile
+++ b/_posts/2009-06-15-msysgit-key-setup.textile
@@ -2,7 +2,7 @@
 layout: default
 title: Generating SSH keys (Win/msysgit)
 description: Setting up SSH keys with msysgit on Windows
-categories: windows setup
+categories: windows
 main_category: setup
 ---
 
diff --git a/_posts/2009-08-14-key-setup-redirect.textile b/_posts/2009-08-14-key-setup-redirect.textile
deleted file mode 100644
index d760f3b..0000000
--- a/_posts/2009-08-14-key-setup-redirect.textile
+++ /dev/null
@@ -1,16 +0,0 @@
----
-layout: default
-title: Generating SSH keys
----
-
-Attempting to redirect to the guide for your OS.  If the redirect fails, pick your OS:
-
-* "Windows":msysgit-key-setup
-* "Mac":mac-key-setup
-* "Linux":mac-key-setup
-
-
\ No newline at end of file
-- 
cgit v1.3.1