Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git enter long passphrase for every push

Tags:

git

linux

ssh

Every time I try to push anything to GitHub it asks me the address [email protected]:... and after that it wants the passphrase. Is there a way to automate this?

I am using Linux Ubuntu.

like image 488
jnbdz Avatar asked May 24 '11 05:05

jnbdz


People also ask

How do I get Git to stop asking for passphrase?

Entering Git Username and Password in Remote URL To prevent Git from asking for your username and password, you can enter the login credentials in the URL as shown. The main drawback of this method that your username and password will be saved in the command in the Shell history file.

How do I stop entering passphrase everytime SSH?

Use ssh-add to add the keys to the list maintained by ssh-agent. After you add a private key password to ssh-agent, you do not need to enter it each time you connect to a remote host with your public key.

How do you enter a passphrase for a key?

$ ssh-keygen -p -f ~/.ssh/id_ed25519 > Enter old passphrase: [Type old passphrase] > Key has comment '[email protected]' > Enter new passphrase (empty for no passphrase): [Type new passphrase] > Enter same passphrase again: [Repeat the new passphrase] > Your identification has been saved with the new passphrase.

Why does Git ask for password every time?

If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository. Using an HTTPS remote URL has some advantages compared with using SSH. It's easier to set up than SSH, and usually works through strict firewalls and proxies.


1 Answers

You can use ssh-agent to remember your passphrase (Gnome automatically runs this for you, normally...).

$ ssh-agent bash $ ssh-add  Enter passphrase for /home/elyobo/.ssh/id_rsa:  Identity added: /home/elyobo/.ssh/id_rsa (/home/elyobo/.ssh/id_rsa) 

From now on, from within the terminal that you run this, your pass phrase will be remembered.

Ideally you'd get it working automatically, so all shells running within gnome would work; check out Gnome Keyring.

like image 167
El Yobo Avatar answered Sep 20 '22 14:09

El Yobo