Reputation: 1022
I have a VPS that is setup with GIT. I can access the server using the user name of git through ssh.
$ssh gitvps <-- Local
git@linux-vps:~$ <-- Now remote
My config file on the local machine looks like -
Host gitvps
HostName SERVERIP
User git
Port 22
IdentityFile "~/.ssh/server/git/id_rsa"
I ran the command ssh -vT gitvps and it says Authenticated but after it reached debus1:Sending env LANG = en_US.UTF-8 it hangs.
When I try to push to my remote using git, it says my key is denied. However, all signs point to me being able to connect just fine
git git@gitvps:/home/git/test.git
Permission Denied. Is it not possible to use an SSH config file to break up all of my id_rsa keys when using GIT?
Upvotes: 2
Views: 69
Reputation: 1323953
Is it not possible to use an SSH config file to break up all of my id_rsa keys when using GIT?
It is possible, and the url of the git repo will be gitvps:/home/git/test.git
(no need for the prefix git@
)
For the IdentityFile part of the .ssh/config
file, I prefer using the full path rather than relying on ~
.
Make sure your .bashrc
, or .profile
or .bash_profile
in your remote server does not do any echo, and does not trigger any process that would not return immediately.
Check also your router, firewall or anti-virus, as mentioned in "git clone hangs forever on github".
As the OP Aaron mentions in another answer, adding ForwardAgent yes
helps.
See "GitHub: Using SSH agent forwarding" and this article:
agent forwarding. In short, this allows a chain of ssh connections to forward key challenges back to the original agent, obviating the need for passwords or private keys on any intermediate machines
So that would be useful if there is an intermediate (proxy?) server between the user and the git repo hosting server.
Although, in case of proxy, the article "SSH Agent Forwarding considered harmful" would recommend using a ProxyCommand
directive instead.
Upvotes: 2
Reputation: 1022
I added ForwardAgent yes to my ssh config file and now it works. I don't understand why but I was desperate and tried a fix for a problem someone else was having. I can now clone and push.
It would be nice if someone could explain why ForwardAgent would be of use in solving my issue.
Upvotes: 0