PageRenderTime 16ms CodeModel.GetById 10ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

Markdown | 40 lines | 25 code | 15 blank | 0 comment | 0 complexity | 465236f452694e68f3061d4485348e51 MD5 | raw file
 1# SSH Setup
 3## Setting up an SSH Key
 4This next step works with msysGit (Git for Windows) or on any *NIX system.
 6    ssh-keygen -t rsa -C ""
 8The `-t` flag is the algorithms used to create the key. The `-C` flag is the comment attached to the key. The comment can serve as a reminder of which system you use this with if you are going to generate more than one key pair to partition your Git SSH key from other SSH-authenticated systems and servers.
10Other algorithms, like DSA, can also be used for SSH authentication and are compatible with Git, since Git is merely using the operating system's underlying SSH capabilities.
12    ssh-keygen -t dsa -C ""
14Lengthier instructions for SSH key generation can be found at the [excellent GitHub page](
16The decision whether or not to use a passphrase for your SSH keys can [also be found on GitHub](
18## Sharing the Public portion of the Key
19Most Git services use half of the key we just generated for authenticating instead of the typical username and password.  In security terms, SSH keys are quite a bit stronger than usernames.
21Keep the private half of the key (`id_rsa`) protected. Give away the public half (``) liberally. You could even store it in a directory service if desired.
23## Authorizing the key on another server
24If you are in control of a server on which you'll be storing Git repos, you can authorize your account to automatically sign in. While logged in to the remote server, put the contents of a user's `` file on a single line (*absolutely no linebreaks!*) on a file named `~/.ssh/authorized_keys`.
26Similarly, key strings are copied-and-pasted to web based repositories like GitHub via the user interface. Copy the contents of `` to the clipboard and paste it into the appropriate textbox in the web UI of GitHub.
28## Testing SSH
29If you wish to test if you have passwordless (key authentication) working correctly, just SSH to the server. It will use your `id_rsa` and `` files automatically if they live in `~/.ssh/`. You should not see any prompt for a password.
31    ssh SERVERNAME
33In the case of a gitolite server, it will report your repository permissions before terminating.
35    hello mccm06, the gitolite version here is v1.5.5-68-g3cf2970
36    the gitolite config gives you the following access:
37         R   W 	gitolite-admin
38        @R  @W 	testing
39        @R   W 	testinglessaccess
40    Connection to mybigserver closed.