I've been somewhat 'putting up' with Github always asking for my username and password when I clone a repository. I want to bypass this step because it is an annoyance within my workflow.
I tried setting up an SSH key (which I successfully did) using this guide. https://help.github.com/articles/generating-ssh-keys and I was successful.
My problem is that I am still asked for my github password and passphrase when cloning a repository (using SSH). My understanding was that after I set up this SSH key, I would no longer have to do that.
I am a little unsure what to ask, so I will just state my goal.
I want to be able to clone repositories without having to put in my Github information all the time.
What am I missing with my SSH key? If anyone can provide some guidance or resources I would appreciate it, because I've always felt a little lost when it came to SSH authentication in GitHub.
From my knowledge, this is a command that tests if things are working properly, here are the output from my console:
~ $ ssh -T [email protected] Saving password to keychain failed Enter passphrase for key '/Users/MYNAME/.ssh/id_rsa': Hi MYNAME! You've successfully authenticated, but GitHub does not provide shell access.
When I input my password, should that fail first? Then, when I enter my passphrase, it passes.
There may be times in which you don't want the passphrase stored in the keychain, but don't want to have to enter the passphrase over and over again. This will ask you for the passphrase, enter it and it will not ask again until you restart.
Make sure the authorized_keys file and the private key itself have the correct permissions and ownership. Check that key-based authentication is allowed by the server. Make sure the private key is readable by the SSH client. If you're using PuTTY, make sure your SSH keys are properly configured for the session.
Adding a password to your SSH key means that the private key will be stored encrypted on your local machine. That private key is a rather sensitive secret since knowing that key grants access to all servers on which you registered the corresponding public key (in your . ssh/authorized_keys file).
There may be times in which you don't want the passphrase stored in the keychain, but don't want to have to enter the passphrase over and over again.
You can do that like this:
ssh-add ~/.ssh/id_rsa
This will ask you for the passphrase, enter it and it will not ask again until you restart.
As @dennis points out in the comments, to persist the passphrase through restarts by storing it in your keychain, you can use the -K
option (-k
for Ubuntu) when adding the identity like this:
ssh-add -K ~/.ssh/id_rsa
Once again, this will ask you for the passphrase, enter it and this time it will never ask again for this identity.
If you work with HTTPs
urls, it'll always ask for your username / password.
If you're correctly using SSH
when cloning / setting remotes. Then make sure you have a ssh-agent to remember your password. That way, you'll only enter your passphrase once by terminal session.
If it is still too annoying, then simply set a ssh-key without passphrase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With