SSH Key - Still asking for password and passphrase
If you work with HTTPs
urls, it'll always ask for your username / password. This could be solved using @Manavalan Gajapathy's comment (copying here):
See this github doc to convert remote's URL from https to ssh. To check if remote's URL is ssh or https, use git remote -v
. To switch from https to ssh:
git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
If you're correctly using SSH
when cloning / setting remotes: make sure you have a ssh-agent to remember your password (see this answer by @Komu). 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.
Add Identity without Keychain
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.
Add Identity Using Keychain
As @dennis points out in the comments, to persist the passphrase through restarts by storing it in your keychain, you can use the --apple-use-keychain
option (-k
for Ubuntu) when adding the identity like this:
ssh-add --apple-use-keychain ~/.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.