How do you setup and use SSH authentication to connect with github/remote repository?
Answer»
To do SSH setup for git; we need to create a '.ssh' directory in the user's HOME directory.
Then in inside (using 'cd' command) this (e.g. '/Users/SandeepChoudhary/.ssh') newly directory, use command 'ssh-keygen -t rsa -C "<your-email-id>"'. Here -t is used to SPECIFY type of key to create and -C(in upper case only) to provide the comment in this case the email-id.
Then during execution of this command, provide inputs like name of file to save the key(just press enter so by DEFAULT it will be saved in 'id_rsa' file, provide passphrase. Now a file 'id_rsa.pub' will be created in '.ssh. Directory.
Now on the github under 'Account Settings' > 'SSH keys' > 'Add SSH key', provide custom title as this ssh key will be tightly coupled with your specific machine where ssh key is generated. Under key option, copy PASTE the content of the 'id_rsa.pub' file from your machine to here and click 'add key'.
Now on your machine using command 'ssh -T git@github.com' you will establish a ssh connection/tunnel with github.