Git authentication failed linux

«fatal: Authentication failed for» when pushing to GitHub from Visual Studio Code (1.62.2)

A lot of us are currently having the issue where we aren’t able to push changes to GitHub anymore and getting a fatal: Authentication failed for error. This has been observed on Linux. This is because the newest version of Visual Studio Code (1.62.2) introduced this bug. Is there a fix for this version, or otherwise a workaround?

There is not even a question here. There is no detail on how you want to authenticate. No debug output like from ssh -vv

7 Answers 7

Pretty working solution ✅

I faced this problem. To fix it, follow these simple steps:

1. Go to your github profile settings

2. Select Developer section and go to Personal Access token

3. Create a new acces Token ( Copy it as soon as it has been generated )

4. Then try to push some changes in your repository, you will be asked to put username and password

5. For the password, just paste the access token you just copied

Happy Coding 🎉🎉🎉🎉

The way I solved it was by downgrading it to 1.62.1, and now it works perfectly again.

I’m on Linux, so this may not apply or work for you, but it should if all Visual Studio Code versions are the same across all OSes.

The Visual Studio Code team has confirmed that it will be fixed on 1.62.3

If you use openSUSE Tumbleweed like me, you can run the following command in the terminal to downgrade:

$ sudo zypper install —oldpackage code-1.62.1

As this question is becoming the canonical question for this Visual Studio Code scandal, perhaps cover more Linux distributions/package managers (with specific instructions)? DT recently made the video «How to downgrade packages In Debian and Arch Linux».

The Ubuntu part (APT/apt-get) starts at 01 min 48 secs. apt list -a code to get the list of possible versions for Visual Studio Code (and the specific format for the version number) and sudo apt install code=1.62.1-1636111026 to downgrade to version 1.62.1. Despite «install» it will downgrade (effectively uninstalling the current version first) — part of the confirmation message is «The following packages will be DOWNGRADED: code»

Читайте также:  Linux версия ядра системы

I can confirm using sudo apt install code=1.62.1-1636111026 to downgrade from version 1.62.2 to 1.62.1 of Visual Studio Code and (again) being able to Git push to GitHub from within Visual Studio Code actually works on Ubuntu MATE 20.04 (Focal Fossa). No other change was made.

It is apparently covered by this issue, to be solved in 1.62.3.

The workaround is to unset Git: Terminal Authentication in the Visual Studio Code settings (menu FilePreferencesSettingsUserExtensionsGitTerminal Authentication).

Enter image description here

The workaround did not make any difference for me (I changed it in both «Workspace» and «User») — precisely the same error message.

Yes, for me it worked on one of my Windows PC, but neither in the other one nor on my Linux machine. I guess downgrading remains the best option.

Here is an extended version. I haven’t tried it (yet) — I went with downgrading Visual Studio Code to 1.62.1 to get it working again, but I may dig deeper later using a separate non-critical non-production environment.

I’m on 1.62.3 now and the issue has been resolved. Open up an issue in the VS Code GitHub repo so that they’re aware of it

Yes, issue resolved in 1.62.3, although be aware you have to restart the integrated terminal session, ie exit it, then start new terminal and not resume a previous session

Adding a username and password (personal token provided by GitHub) to the remote URL, resolved the issue for me.

git remote set-url origin https://username:password@github.com/organization/repo.git

To generate your personal access token visit: https://github.com/settings/tokens

If you are windows. And you changed the password of the git credential recently. You may see the error in the next git action or new clone.

  1. Go to Control Panel ->All Control Panel Items ->Credential Manager
  2. Go to Windows Credentials.
  3. Find the existing GIT URL git:https://xxxxx under Generic Credentials.
  4. Edit the credential, and enter new password. Then try your actions again.

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Читайте также:  Автоматическое монтирование ресурса linux

This post here solved my issue.

I had temporarily been using git config —global credential.helper cache and pushing commits in the regular Linux shell using a personal access token.

After entering and caching in the regular Linux shell, I’ve so far been able to push commits per usual in Visual Studio Code’s terminal.

UPDATE: Tried Git store with the command $ git config credential.helper store and Im now able to push to my repo no problem without having to input the PAT with every push. Cache only works temporarily. Also found a pretty in-depth post here that explains the process of storing github PATs for mac, windows and linux more in depth. However, it’s an old post.

Источник

Github — Fatal Authentication Failed — Yet I can still connect?

My github isn’t connecting. I’ve tried two different computers and I’m getting the same error so clearly I’m doing something wrong. When I run git push I get prompted for my username / password as expected. Type them in, and yes I’m typing them correctly. Then it says:

fatal: Authentication failed 

However when I type ssh -T git@github.com it prompts me for my passphrase and after entering that, it welcomes me to github. I’ve tried to add the SSH key again and all it says is this SSH key is already on the account. Someone let me know what I’m missing? When I try to login it shows: Password for http://(UserName)@www.github.com: Is that correct? More Information: Here’s the output of ssh-vT git@github.com:

$ ssh-add -l Could not open a connection to your authentication agent. 
$ ssh -vT git@github.com OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 debug1: Connecting to github.com [192.30.252.129] port 22. debug1: Connection established. debug1: identity file /l/.ssh/identity type -1 debug1: identity file /l/.ssh/id_rsa type 1 debug1: identity file /l/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debia n-5ubuntu1+github5 debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1+github5 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-cbc hmac-md5 none debug1: kex: client->server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /l/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /l/.ssh/identity debug1: Offering public key: /l/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 debug1: read PEM private key done: type RSA debug1: Authentication succeeded (publickey). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: Remote: Forced command. debug1: Remote: Port forwarding disabled. debug1: Remote: X11 forwarding disabled. debug1: Remote: Agent forwarding disabled. debug1: Remote: Pty allocation disabled. debug1: Remote: Forced command. debug1: Remote: Port forwarding disabled. debug1: Remote: X11 forwarding disabled. debug1: Remote: Agent forwarding disabled. debug1: Remote: Pty allocation disabled. debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 Hi ____! You've successfully authenticated, but GitHub does not provide shell ac cess. debug1: channel 0: free: client-session, nchannels 1 debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0 debug1: Exit status 1 

Источник

Читайте также:  Linux which java version change

Git suddenly stopped working

as all the times before. The first ( fetch ) actually worked but the second ( pull ) failed though I provide exactly the same credentials.

Username for 'https://github.com': XXXXXXXXX Password for 'https://XXXXXXXXX@github.com': remote: Counting objects: 15, done. remote: Compressing objects: 100% (6/6), done. remote: Total 15 (delta 9), reused 15 (delta 9), pack-reused 0 Unpacking objects: 100% (15/15), done. From https://github.com/XXXXXXXXX/chef-repo.git 55e79f9..4fd7878 master -> origin/master Username for 'https://github.com': XXXXXXXXX Password for 'https://XXXXXXXXX@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/XXXXXXXXX/chef-repo.git' 

Because I used this procedure multible times the last few hours I wanted to check again if I had maybe a typo in the pull procedure. But now I get this error already on the first command though there is no doubt I provide the correct credentials

$ git fetch Username for 'https://github.com': XXXXXXXXX Password for 'https://XXXXXXXXX@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/XXXXXXXXX/chef-repo.git' 
  • The repository is for Chef on the Chef-Workstation so removing the folder and clone again is not an option for me or at least the very last because a lot of stuff is excluded via .gitignore and I don't know if e.g. any links could brake.
  • I don't use Two-Factor Authentication.
  • I didn't change anything especially not inbetween the two commands.
  • I still can login to Gihub on the webpage using my credentials.
  • I can fetch/pull from other machines.

I've read about this here and also here (though I don't use SSH but password authentification) but nothing helped so far.

Here the ouput of git remote -v

origin https://github.com/XXXXXXXX/chef-repo.git (fetch) origin https://github.com/XXXXXXXX/chef-repo.git (push) 

Источник

Оцените статью
Adblock
detector