Information Technology Reference
In-Depth Information
uses SSH protocol. You will find a complete reference of protocol used by git in Table
11-2.
12-2. Configuring a Github account with
SSH keys
Problem
You want to configure your Github account in such a way that git allows you to clone,
fetch, and push using SSH URLs.
Solution
To complete this recipe you will need an SSH key pair. Check if your
∼
/.ssh/
direct-
ory contains them. Open a bash window and list the contents of the .ssh directory:
$ ls
∼
/.ssh
If this directory doesn't contain the
id_rsa
and
id_rsa.pub
files, then you
have to generate them. The command you need is:
$ ssh-keygen -t rsa -C
your.email@example.net
This command will ask you two questions that were explained in Recipe 11-5 under
the RSA keys section. The first question sets the names for the two files with keys; the
second sets the use of a passphrase to protect your keys. If you press
ENTER
the files
will be stored in default location and the passphrase will not be used.
When the
id_rsa
and
id_rsa.pub
files are ready, start your web browser and
visit Github.com. Follow the link titled “Sign up for GitHub;” when you finish, log in
using your newly created account.