Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub spuriously requesting password #1176

Closed
treyharris opened this issue May 10, 2016 · 4 comments
Closed

hub spuriously requesting password #1176

treyharris opened this issue May 10, 2016 · 4 comments
Labels

Comments

@treyharris
Copy link

By adding my GitHub SSH key to ssh-add, I'm able to interact password-lessly most of the time. But sometimes, this happens:

$ git clone caskroom/homebrew-cask
github.com password for treyharris (never stored):
Cloning into 'homebrew-cask'...
remote: Counting objects: 199958, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 199958 (delta 2), reused 0 (delta 0), pack-reused 199951
Receiving objects: 100% (199958/199958), 59.24 MiB | 8.45 MiB/s, done.
Resolving deltas: 100% (136746/136746), done.
Checking connectivity... done.

When it requested a password there, I just pressed return without entering anything, yet it continued successfully.

Unfortunately, that didn't continue to be the case:

$ cd homebrew-cask
$ git fork
github.com password for treyharris (never stored):
Error forking repository: Unauthorized (HTTP 401)
Bad credentials
$ git remote -v
origin  git://github.com/caskroom/homebrew-cask.git (fetch)
origin  git://github.com/caskroom/homebrew-cask.git (push)

To demonstrate, my SSH key is valid:

$ ssh-add -l
2048 SHA256:Uq8lTltyyQsm5O5v0mGzTpA5Pp0wdstcO0tz3OEexJc /Users/trey/.ssh/github_rsa (RSA)
$ ssh -T git@github.com
Hi treyharris! You've successfully authenticated, but GitHub does not provide shell access.

And I can access private repos without a password:

% git clone -p treyharris/emacs.d
Cloning into 'emacs.d'...
remote: Counting objects: 3314, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 3314 (delta 506), reused 502 (delta 502), pack-reused 2806
Receiving objects: 100% (3314/3314), 3.43 MiB | 959.00 KiB/s, done.
Resolving deltas: 100% (1449/1449), done.
Checking connectivity... done.
% cd emacs.d
% git remote -v
origin  git@github.com:treyharris/emacs.d.git (fetch)
origin  git@github.com:treyharris/emacs.d.git (push)
@Arzte
Copy link

Arzte commented May 11, 2016

Git fork uses the github api endpoint, which doesn't use ssh rather it uses https and passwords.

@treyharris
Copy link
Author

@TheDoctorsLife Understood, but that doesn't explain the first password request—which I was able to just skip without entering anything.

@mislav
Copy link
Owner

mislav commented Aug 7, 2016

@treyharris Thanks for reporting, and sorry for the late reply! If you didn't enter a password when hub asked you to, or if you entered a wrong password, hub should definitely exit with an error message without continuing. That's a bug, and I'll try to fix it.

@mislav mislav added the bug label Aug 7, 2016
@mislav
Copy link
Owner

mislav commented Aug 7, 2016

Duplicate of #1122

@mislav mislav closed this as completed Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants