Saturday, March 14, 2015

SSH Key Pairs

SSH keys are a way to identify trusted computers, without involving passwords.

Generate private and public key pair.

Generating SSH keys 

1. ls -la ~/.ssh/git
2. ssh-keygen -t -rsa -C "<emailID@email.com>"
      Enter location of id_rsa file
      Enter passphrase

Add key to SSH agent

1. Ensure SSH agent is enabled 
      eval "$(ssh-agent -s)"
2. Add private key to SSH agent
      ssh-add ~/.ssh/git/id_rsa

Add public key to git account

1. pbcopy < ~/.ssh/git/id_rsa.pub

Test the connection

1. ssh -T git@github.com

Cloning a repository

/home:>git clone git@github.com:coderetriever/Android.git

creates /home/Android directory with all the source folders

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home