William Jiang

JavaScript,PHP,Node,Perl,LAMP Web Developer – http://williamjxj.com; https://github.com/williamjxj?tab=repositories

github.com: generate SSH keys

github.com and SSH keys

github.com access needs SSH keys permission. Here I list the process of generating ssh-key between my Unbuntu desktop and github.com remote server. Quite easy.
In my Unbuntu desktop:

$ cd $HOME

# If ssh-keygen command doesn't exist, you need to apt-get install.
$ ssh-keygen -t rsa

# a new directory .ssh is generated.
cd $HOME/.ssh

There are 2 files generated in .ssh directory.

  1. id_rsa
    This is private key file which is kept locally
  2. id-rsa.pub
    This is the file need to sync in github.com and locally.

Now copy contents in $HOME/.ssh/id_rsa.pub, and paste it in github: https://github.com/settings/ssh:
Title: could be any string
Key: copy the above context to here and save.

After the authenication, now the following works:

$ git remote add origin git@github.com/account_name/repository_name.git
$ git push -u origin master
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 75 other followers

%d bloggers like this: