Why do I keep getting “Authentication Failed” on Github when running through the Win10 Linux subsystem?
I'm on a machine running Windows 10, with Developer Mode enabled and the Linux Subsystem installed. When I switch into bash, I am trying to run a simple clone command from git:
git clone https://github.com/PrivateRepo/my-private-repo.git
Of course I've scrubbed the URL here a bit, but you get the idea. Initially, the response I got back from that command was this:
fatal: unable to access 'https://github.com/PrivateRepo/my-private-repo.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I saw a few Stack Overflow answers talking about that but to be honest I don't really know the proper way to deal with that error. With that said, I know an improper way which is to just circumvent it completely, by running the following command:
git config --global http.sslverify false
And that seems to work. It's probably bad that I'm turning off all SSL verification, but I need to get this working, and it's not really the point of this question (which I'm getting to). But as an aside if you know the proper way to fix that I'm all ears.
Next, I re-ran my git clone
command, and this time it prompted me for a username and password, but utlimately ended up failing for a different reason. Here's what it looked like:
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser
Password for 'https://myuser@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
However, I can assure you that the username I typed was correct, as was the password. I also have Git for Windows installed, and when I tried it there everything worked. The only caveat was that instead of prompting me for a password in the command line, it opened a separate window to enter credentials and there it also asked me for my six-digit 2FA code. Then it cloned just fine. I noticed that in doing so it created a Personal Access Token in Github. So I went ahead and created another Personal Access Token, and tried to use it manually in bash. Basically instead of typing myuser
for the username I typed myuser:mytoken
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2
Password for 'https://myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
But as you can see it still failed. How do I get git working in bash on Windows?
linux git github windows-subsystem-for-linux two-factor-authentication
add a comment |
I'm on a machine running Windows 10, with Developer Mode enabled and the Linux Subsystem installed. When I switch into bash, I am trying to run a simple clone command from git:
git clone https://github.com/PrivateRepo/my-private-repo.git
Of course I've scrubbed the URL here a bit, but you get the idea. Initially, the response I got back from that command was this:
fatal: unable to access 'https://github.com/PrivateRepo/my-private-repo.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I saw a few Stack Overflow answers talking about that but to be honest I don't really know the proper way to deal with that error. With that said, I know an improper way which is to just circumvent it completely, by running the following command:
git config --global http.sslverify false
And that seems to work. It's probably bad that I'm turning off all SSL verification, but I need to get this working, and it's not really the point of this question (which I'm getting to). But as an aside if you know the proper way to fix that I'm all ears.
Next, I re-ran my git clone
command, and this time it prompted me for a username and password, but utlimately ended up failing for a different reason. Here's what it looked like:
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser
Password for 'https://myuser@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
However, I can assure you that the username I typed was correct, as was the password. I also have Git for Windows installed, and when I tried it there everything worked. The only caveat was that instead of prompting me for a password in the command line, it opened a separate window to enter credentials and there it also asked me for my six-digit 2FA code. Then it cloned just fine. I noticed that in doing so it created a Personal Access Token in Github. So I went ahead and created another Personal Access Token, and tried to use it manually in bash. Basically instead of typing myuser
for the username I typed myuser:mytoken
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2
Password for 'https://myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
But as you can see it still failed. How do I get git working in bash on Windows?
linux git github windows-subsystem-for-linux two-factor-authentication
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24
add a comment |
I'm on a machine running Windows 10, with Developer Mode enabled and the Linux Subsystem installed. When I switch into bash, I am trying to run a simple clone command from git:
git clone https://github.com/PrivateRepo/my-private-repo.git
Of course I've scrubbed the URL here a bit, but you get the idea. Initially, the response I got back from that command was this:
fatal: unable to access 'https://github.com/PrivateRepo/my-private-repo.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I saw a few Stack Overflow answers talking about that but to be honest I don't really know the proper way to deal with that error. With that said, I know an improper way which is to just circumvent it completely, by running the following command:
git config --global http.sslverify false
And that seems to work. It's probably bad that I'm turning off all SSL verification, but I need to get this working, and it's not really the point of this question (which I'm getting to). But as an aside if you know the proper way to fix that I'm all ears.
Next, I re-ran my git clone
command, and this time it prompted me for a username and password, but utlimately ended up failing for a different reason. Here's what it looked like:
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser
Password for 'https://myuser@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
However, I can assure you that the username I typed was correct, as was the password. I also have Git for Windows installed, and when I tried it there everything worked. The only caveat was that instead of prompting me for a password in the command line, it opened a separate window to enter credentials and there it also asked me for my six-digit 2FA code. Then it cloned just fine. I noticed that in doing so it created a Personal Access Token in Github. So I went ahead and created another Personal Access Token, and tried to use it manually in bash. Basically instead of typing myuser
for the username I typed myuser:mytoken
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2
Password for 'https://myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
But as you can see it still failed. How do I get git working in bash on Windows?
linux git github windows-subsystem-for-linux two-factor-authentication
I'm on a machine running Windows 10, with Developer Mode enabled and the Linux Subsystem installed. When I switch into bash, I am trying to run a simple clone command from git:
git clone https://github.com/PrivateRepo/my-private-repo.git
Of course I've scrubbed the URL here a bit, but you get the idea. Initially, the response I got back from that command was this:
fatal: unable to access 'https://github.com/PrivateRepo/my-private-repo.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
I saw a few Stack Overflow answers talking about that but to be honest I don't really know the proper way to deal with that error. With that said, I know an improper way which is to just circumvent it completely, by running the following command:
git config --global http.sslverify false
And that seems to work. It's probably bad that I'm turning off all SSL verification, but I need to get this working, and it's not really the point of this question (which I'm getting to). But as an aside if you know the proper way to fix that I'm all ears.
Next, I re-ran my git clone
command, and this time it prompted me for a username and password, but utlimately ended up failing for a different reason. Here's what it looked like:
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser
Password for 'https://myuser@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
However, I can assure you that the username I typed was correct, as was the password. I also have Git for Windows installed, and when I tried it there everything worked. The only caveat was that instead of prompting me for a password in the command line, it opened a separate window to enter credentials and there it also asked me for my six-digit 2FA code. Then it cloned just fine. I noticed that in doing so it created a Personal Access Token in Github. So I went ahead and created another Personal Access Token, and tried to use it manually in bash. Basically instead of typing myuser
for the username I typed myuser:mytoken
git clone https://github.com/PrivateRepo/my-private-repo.git
Cloning into 'my-private-repo'...
Username for 'https://github.com': myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2
Password for 'https://myuser:a1abcdefab2a34567ab8901a2bc3d4567890a1b2@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/PrivateRepo/my-private-repo.git'
But as you can see it still failed. How do I get git working in bash on Windows?
linux git github windows-subsystem-for-linux two-factor-authentication
linux git github windows-subsystem-for-linux two-factor-authentication
asked Feb 28 '18 at 20:58
Gordon MyersGordon Myers
38661336
38661336
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24
add a comment |
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24
add a comment |
1 Answer
1
active
oldest
votes
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1299263%2fwhy-do-i-keep-getting-authentication-failed-on-github-when-running-through-the%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
add a comment |
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
add a comment |
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
You need to just use your user name and then instead of your password use your access token. You don't need your password as the token replaces it.
answered Jan 30 at 17:48
JeffJWillsJeffJWills
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1299263%2fwhy-do-i-keep-getting-authentication-failed-on-github-when-running-through-the%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Developer mode isn’t required for WSL. Why do you still have it enabled. I assume your using 1709. Authentication is failing because you disabled SSL.
– Ramhound
Feb 28 '18 at 21:24