Score:0

ssh -A still not allowing git pull

cn flag

We have a setup where our git server needs the publickeys to authenticate in order to push or pull. I am trying to do so on one of our servers and can't figure out why it isn't working. I have searched and searched and everything I have found says to just run ssh -A when logging into the server and that should forward what is needed to allow git operations, but it isn't working.

On my local machine, I can cd into a directory, run git push origin master type in my password for ~/.ssh/id_rsa and it works perfectly.

When logging into the server I tried using ssh-add ~/.ssh/id_rsa putting in my password, then running ssh -A [user]@[server] and it logs in fine, I then cd into the directory and run git pull to which I am given permission denied (publickey)

I can't figure out why it is not allowing me to push or pull from the server, it works locally, and I am using the -A flag when ssh-ing into the server, but always permission denied (publickey)

Hopefully someone much more skilled in server stuff can see that I am just doing something wrong and it's an easy fix. Thank you all, I appreciate the time and help

Score:0
jp flag

Use GIT_SSH_COMMAND="ssh -v" git pull to get verbose output from ssh.

cn flag
Run that on the server after I ssh into the server?
jp flag
@NeglectedSanity you run this instead of plain `git pull`
Score:0
tv flag

I honestly don't understand your setup completely, but in general I can recommend using a SSH config file for such use cases.

For example if your server name is my-server.com, it could look like the following:

Host my-server.com
 HostName my-server.com
 Port 22
 IdentityFile ~/.ssh/id_rsa

It will prompt you for your passphrase for the private key.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.