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 create asks for username and password when it should be using ssh #2522

Closed
DAMO238 opened this issue Apr 23, 2020 · 1 comment
Closed
Labels

Comments

@DAMO238
Copy link

DAMO238 commented Apr 23, 2020

Command attempted:
hub create with git config --global hub.protocol ssh

What happened:
Every time you run this, rather than asking for my ssh key password, like git would when running git push, it asks for my username and password (which won't work because I don't have any access tokens set up for repository creation and my main password needs 2fa)

More info:

Hub version: 2.14.2
Git version: 2.26.1
OS: Arch (kernel: 5.6.4-arch1-1)
git remote get-url origin output is git@github.com:DAMO238/dotfiles.git

@DAMO238 DAMO238 added the bug label Apr 23, 2020
@mislav
Copy link
Owner

mislav commented Apr 25, 2020

Hub needs to communicate with the GitHub API, and that communication cannot be done over SSH #1644 (comment). Therefore, hub needs to authenticate with your username + password + 2FA. If you had actually given your real password, you would be prompted for 2FA (trust me— it will work!). You may also generate a token and paste that instead of your real password.

The SSH protocol is used only for git operations like clone, fetch, and push, but API communication is done separately from git and that's why we sometimes need two separate modes of authentication.

@mislav mislav closed this as completed Apr 25, 2020
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

2 participants