Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two machines (a. Ubuntu machine b. Windows machine)

I have cloned code from a github repo in the Ubuntu machine and I am able to run git commands if I login into the Ubuntu machine (directly)

But if I login into the Ubuntu machine (using the same userid) via a Windows machine (using putty), then it fails to pull code on a git pull. It results in a permission denied error

Permission denied (publickey). fatal: The remote end hung up unexpectedly

Why I am not able to pull code if I login from my Windows machine?

share|improve this question

migrated from stackoverflow.com Mar 27 '13 at 2:25

This question came from our site for professional and enthusiast programmers.

    
Are you using the same user to login via SSH from windows , I mean same user you used to login directly in your ubuntu –  aravind.udayashankara Oct 15 '12 at 6:49
    
yes, am using the same user credentials to login into the Ubuntu machine. –  Joshua Oct 15 '12 at 6:57
    
Is your $HOME defined properly once logged through your putty session? It will be needed for getting to your ssh public/private keys. –  VonC Oct 15 '12 at 7:03
    
are you logging in via the GUI when directly logging in on the Ubuntu machine? –  Douglas Leeder Oct 15 '12 at 10:16

1 Answer 1

up vote 0 down vote accepted

I suspect your ssh private key is being unlocked by the ssh-agent setup by your GUI login on the Ubuntu machine, whereas your putty/ssh connection isn't setting up an ssh-agent correctly to get access to your private key.

You could try running eval $(ssh-agent) and ssh-add to setup an agent on your ssh connection.

I'm surprised that git isn't asking for your password in this case though?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.