How To Generate SSH Key and Add To Github
In previous entry, we just create account with github(http://software.krimnet.com/how-create-account-with-github.htm). Here, follow the step on how to generate and add SSH Key to Github;
1. Install git client. Get it from: http://192.168.203/os/index.php?dir=git Choose Git-1.7.0.2-preview20100309.exe.
Refer How To Install Git Client: http://software.krimnet.com/how-to-install-git-client.htm.
2. Run Git Bash. 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.
3. First check to see if a ssh key directory exists.
[img_assist|nid=902|title=check|desc=|link=none|align=left|width=321|height=42]
If you get a “No such file or directory” error, you can skip to “Generating a key”.
[img_assist|nid=903|title=ls|desc=|link=none|align=left|width=321|height=109]
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.Picture below show the existed ssh key directory.
[img_assist|nid=904|title=exist|desc=|link=none|align=left|width=511|height=259]
GENERATING A KEY
[img_assist|nid=905|title=key|desc=|link=none|align=left|width=640|height=363]
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 for more details on why you should use a passphrase and how to avoid re-entering it every time you use your key.
ADDING THE KEY TO THE 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 key into the “key” field. If you leave the title blank the key comment (your email) will be used for the title.
[img_assist|nid=929|title=add_another|desc=|link=none|align=left|width=640|height=415]
id_rsa.pub in our example), and do not add any newlines or whitespace inside the key. But, where is the key to copy?1. Now, right click to your Git Bash icon on desktop. 2. Choose Git Gui.
[img_assist|nid=907|title=opengitgui|desc=|link=none|align=left|width=640|height=349]
3. Show SSH Key.
[img_assist|nid=908|title=show|desc=|link=none|align=left|width=640|height=348]
4.Now, open your account page to paste the key. Click to Add Another Public Key.
[img_assist|nid=930|title=paste|desc=|link=none|align=left|width=640|height=385]
5.Paste the key and Add Key.
[img_assist|nid=932|title=paste|desc=|link=none|align=left|width=640|height=385]
6.Done. Successfully adding your key to github.
[img_assist|nid=931|title=done|desc=|link=none|align=left|width=640|height=402]
See next, How To Add User As Collaborator(http://software.krimnet.com/how-to-add-collaborator-by-admin.htm).
- tuan.norlida's blog
- Login to post comments
Copyright © 2008-2011