11

When I attempt to git pull origin [branch] in order to pull in changes to the repo, I am prompted for a password. My system password and just hitting enter return: "fatal: Authentication failed".

The thing is, I never entered a password for this project in the past and this was not the case when I began it last week, nor any of the times I pushed and pulled since then. Speaking to my client, they thought it was something with my SSH keys.

I double checked the keys and made sure they were correct, running ssh git@github.com. I'm getting:

Hi bdkay! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed.

which makes me think it succeeded. However, right before that a troublesome line reading: "PTY allocation request failed on channel 0" occurs. The client says I'm still added to the repo in github and they have not changed anything on their end. I'm still working on the same machine but cannot seem to find a fix through google or searching this site. Any help is greatly appreciated.

Brendon
  • 147
  • 1
  • 2
  • 8
  • "PTY allocation request failed on channel 0" means that SSH requested a pseudoterminal (PTY), basically a "container" for the shell, and that request failed. Which is just what you'd expect, because GitHub doesn't offer shell access. Unfortunately that may mean there isn't enough information here to suggest a solution... perhaps try running `git fetch -v origin [branch]` and linking to or pasting the output? – David Z Sep 27 '11 at 19:26
  • git fetch -v origin workspace-ie also prompts me for a password, and returns fatal: Authentication failed on system password or password left blank – Brendon Sep 27 '11 at 19:39
  • I meant the _entire_ output. The point is to see the error message in context. – David Z Sep 27 '11 at 19:41
  • I guess I don't understand what you mean by entire output. Please excuse my ignorance, I'm a beginner with git, rails and linux. If there's a command I can provide to show entire output let me know. – Brendon Sep 27 '11 at 19:46
  • I mean exactly what I said, the entire output of the command. So far you've only been providing one line of the output, but we need to see everything git prints out, exactly as it shows up on your screen. You run the command, select the text in your terminal, copy it, and paste it into the question. (Indent by 4 spaces to get it to format as code) For an example, look at the second code block ("'normal' output of the git clone command") in http://stackoverflow.com/q/7561359. – David Z Sep 27 '11 at 19:52
  • In Unix, that's literally the entire output. ➜ fbolt git:(workspace-ie) ✗ git fetch -v origin workspace-ie Password: fatal: Authentication failed – Brendon Sep 27 '11 at 20:05

1 Answers1

24

If you're being prompted for a password, and not your SSH key's passphrase, then you're not using the SSH URL. HTTPS asks for user/pass auth, SSH uses key/passphrase. Check your remote's URL with git remote -v, and if you need to fix it use git remote set-url.

Tekkub
  • 30,739
  • 2
  • 30
  • 20
  • Thanks Tekkub! Somehow my remote's URL got switched t the HTTPS URL. I used git remote set-url to switch it back to SSH and it works perfectly. Thanks again – Brendon Oct 04 '11 at 21:08
  • 1
    @Brendon: You should accept this answer, if it solved your problem. Just click the tick. – vikingosegundo Oct 07 '11 at 00:50