Token not working in command line

I have created a PAT, but when I am prompted in the command line to enter a username and password and I use my PAT as my password, I receive a remote output that support for password authentication was removed etc etc.

Isn’t the PAT supposed to be used in place of a password?

2 Likes

Yes, it should work that way. I just tried and it worked.

It looks like you get the message that password authentication if you put anything into the password prompt that isn’t a valid token. Maybe you accidentally copied a space next to the token, too, or something like that?

I wish it were that simple, but I’ve copied it probably 10 times, and also created new tokens to try again.

Since you can’t see your password when you past it in the command line, I can’t absolutely confirm that it’s accurate, but I know I’m copying only the token characters from my GH account page. I’ve used the copy icon and also highlighted my token manually.

That’s odd! In that case the only thing I can think of is to share your platform (OS) and Git version (ideally check for updates if you haven’t already), maybe someone else has encountered a similar issue.

Or try using SSH instead of HTTPS.

1 Like

I appreciate your help so far. I will look into SSH later on.

Here is my additional info:

OS: Windows 10
git version: 2.32.0.windows.2

hi a have same problem with same versions of windows and git.
look at my problem on youtube. dont answer there as youtube cannot show me answers, i d know why. if you have any solutions please give me too. thanks bye bye

now succeded! i deleted my .git files from my pc, reinstalled the git program, make everything again, and now working. i just had 1 file to add and commit so wasnt a big deal. cheers all of you

1 Like

@Feri982

it sounds like my credentials are still stored somewhere. I removed them from windows credential manager the other day, so it’s not there. Perhaps in one of my git init files. I will test that out later, TBD

deleted my old .git folder and restarted with a new git init. still getting the same error message while using my PAT as my password.

Do you reinstall the git app?

@Feri982

I did do a full re-install after deleting my .git file. Terminal is still telling me that password authentication was removed etc. etc. when I enter my PAT as my password.

I’m sorry sir. I have no more idea. Rewoke the token, make new one and try it. I tick all the cube when I made new token.

  1. augusztus 15., vasárnap dátummal backfromsolaris via GitHub Support Community <githubcommunity@discoursemail.com> ezt írta:

I am also running into issues after the Friday the 13th changes that no longer support password access.

In particular I can not get my Windows 10 machine to upload anything to github through either the CLI or the Github desktop. For example tried pushing up change to a read me file using the desktop:
image
I went up tried logging off and logging on, still does it.

Over the weekend I tried uninstalling both Git and Github desktop, I tried to delete most all of the git configuration files I know of, except not the git files that are in each project (I think I have over 200)

I reinstalled both, Repopulated most of the projects into desktop using drag and drop. Still same issue.

On one project I got around it first time, by copying files to my Linux install and then had editor change line endings… And then upload…

Since then I have pushed up several changes by having a Ubuntu window open on my Windows 10 machine, and using git from there to push up the changes using PAT… Note: the CLI on WIndows 10 does not prompt me for password are anything It just also gives similar error:

D:\GitHub\AX12_Phoenix_PhantomX_float>git push
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/mjs513/AX12_Phoenix_PhantomX_float.git/': The requested URL returned error: 403

D:\GitHub\AX12_Phoenix_PhantomX_float>git remote -v
origin  https://github.com/KurtE/AX12_Phoenix_PhantomX_float.git (fetch)
origin  https://github.com/KurtE/AX12_Phoenix_PhantomX_float.git (push)
upstream        https://github.com/mjs513/AX12_Phoenix_PhantomX_float.git (fetch)
upstream        https://github.com/mjs513/AX12_Phoenix_PhantomX_float.git (push)

So question is what obvious thing am I missing?

Thanks
Kurt

Just an FYI - I created a different thread about my github commands and desktop not working…

Found that I had a file: _netrc file in my user root directory with github information. I deleted that file and finally was able to access github again… Using normal methods.

I’m also having the same issue, I copied my new token but I still get the password authentication removed error, and can’t commit at all.

Sorry @Meister-anon - Been there!

Hopefully others will have more complete answers. It took me several days of madness before I finally got my system to work. You did not mention what setup you are using… Linux, Mac, Windows…

My main problems was Windows 10… So until then I did things like, copy stuff to my Linux box and check it in using it… (Had to fix line endings first)… Then found I could on my Windows machine, I could could commit but could not push… So I used Github desktop for windows to check in. I then opened a Ubuntu APP on my Windows machine and I could use the Git under ubuntu to do the push… Which kept me limping along until I fixed Windows…

What I did on Windows (some may apply to other platforms as well).
a) I deleted (removed) my install of Github Desktop and git commands, and then reinstalled with the latest binaries…
b) Deleted the credentials using the credential Manager
c) uninstalled PuTTy and went into regedit and deleted most every reference I found to github and putty (then uninstalled git and reinstalled again)
d) removed the c\users\kurte.ssh directory contents… As to remove known hosts… Note: I did have github in this from before… But still did not work… (uninstalled and reinstalled again)…
e) finally found the _netrc file in my root directory which again had github and password in it. Finally removed this file again deleted credentials, found that git released new binaries so installed those and finally everything worked…

Hopefully you don’t have to go through all of these steps, but maybe it will give you some hints on places to look, like PuTTy, like ~/.ssh ~/_netrc update commands commands.

Good luck!

thanks for the response, I’m also using windows 10.

I got some helping setting up my system and was able to do
all my commits and pushes etc via the windows command line.

Since I couldn’t figure out the issue with the token, I’ve been unsuccessfully
attempting to set up an ssh key to use instead.

I don’t have any computer experience over what I’ve specifically taught myself
to get what I wanted done, so this whole token thing has been
a very complex and frustrating process for me.

I really wish I could just go back to using my password,
I’m just a small-scale user, so any increase in security the token system provides,
isn’t really much benefit to me.

I have github’s desktop app, but I didn’t like the interface so I never use it.
Otherwise I don’t believe I use the other things you have setup.

I just use command line for running git commands,
and visal studio for editing.

I have years (lots) of computer experience, and I was frustrated as well!

The earlier versions of the desktop app were not as good as the more current ones. I still use CLI for some things, like I work with others so I often have my fork (origin) and work to get things into the “Upstream” fork where I keep the main/master branch clean and in sync with upstream…

They have also improved the desktop to allow more options, like I mostly use sublime text for editing and they now have settings to allow that…

Other things I have mentioned like: PuTTy (and KiTTy) and WinSCP are things I use when I am playing with things like Rasberry Pi boards (or Odroid or UP or …)

again if it were me (and it was), the things I would check include:

  1. What version of git are you running? I am running:
D:\GitHub\MTP_t4>git version
git version 2.33.0.windows.1

If yours is not reasonably recent, I would probably upgrade to a later one:
https://git-scm.com/download/win
Looks like they released one today.

  1. try opening the Credential manager (I start type credential in the windows search box , click on the Windows Credentials tab and look for anything that mentions github … and probably delete

  2. again check your root directory in my case: c:\users\kurte
    and look for directory: .ssh - and check to see if there is a hosts file that mentions github… Delete…
    likewise look for file: _netrc in your root directory and delete…
    I also deleted my .gitconfig file in that directory as well…
    There may be a few other places to look as well, like under your root directory: appdata
    there may be locations under local or remote that cache some of this data as well…

But then hopefully the install of the current release of GIT will give you some hints.
For example the install may ask you which ssh to use normal or the putty one if that is installed…

But finally after I removed all of the things that told the system what the user/password was for github, when I finally reinstalled git (probably 4th time) and then I probably did something like:
git config --global user.name kurte
git config --blobal user.email

and then finally git push - The system finally came up with a prompt asking me if I wanted to enter a password (credential) or use the web browser to authenticate… and then everything worked

thanks, but I was able to get ssh keys setup.

was a bit confusing since I had to go through like 5 different git articles
but its working well now.