Git not storing credentials when sshed into server

Viewed 34

I have a ubuntu VM which I SSH into from a windows machine to develop on. I have my windows pub key on the linux VM so I can ssh without password.

On the linux machine I have set to store my git credentials. When I do any git command on the VM directly, it is able to use the stored credentials and carries out the given task. However, if I ssh into the VM from windows, and try to do any git command, it never stores the credentials and each time I have to reenter the password.

What is causing this and is there a way to fix it?

1 Answers

Compare the output of git config --show-scope --show-origin credential.helper when:

  • you are logged in directly on the Linux server
  • you are logged in through SSH from Windows

This assumes that, in both instances, you are using an HTTPS URL from your Linux server when using git clone/push/pull to a remote server.

If the Git on Linux is not recent enough, use simply git config --global credential.helper.

Related