Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remote: Invalid username or password, fatal: Authentication failed for

Tags:

git

github

ubuntu

I have just clone repo an then make one commit add it and was trying to push it - but have this error: enter image description here

Any ideas how can I fix this evill?

like image 208
Rahil Avatar asked Jul 28 '14 15:07

Rahil


People also ask

How do I fix remote invalid username or password fatal authentication failed?

The “remote: invalid username or password” error informs you that you have incorrectly authenticated to a Git server. To solve this error, make sure that you have used the right username and password and that you are trying to access a Git repository using the correct URL.

How do I fix my git username and password?

Saving Remote Git Repository Username and Password on Disk The second method is to use the Git credentials helper to save your username and password in a plain file on disk as shown. From now on, Git will write credentials to the ~/. git-credentials file for each URL context, when accessed for the first time.


2 Answers

I had the same problem with my first GitHub repository just now. In my case, the problem was related to having enabled two-factor authentication. I had GitHub make an authentication token since the command line tools aren't aware of two-factor authentication.

The problem was that double-clicking the token to select it somehow selected a space to its left as well, resulting in me copying an invalid code. Carefully click-dragging from one end of the token to the other worked.

like image 94
Mark Haferkamp Avatar answered Oct 05 '22 10:10

Mark Haferkamp


If you want to push to https://github.com/AntonDerenivsky/lado, you should use the credentials of AntonDerenivsky.

Using 'fresa' would only work if fresa has been declared as collaborator for AntonDerenivsky/lado repo.

Or you need to fork that repo, and use:

git remote rename origin upstream
git remote add origin  https://[email protected]/fresa/lado
git push -u origin master

If AntonDerenivsky is your gitHub account, the the login to use is 'AntonDerenivsky', not 'fresa'.

like image 33
VonC Avatar answered Oct 05 '22 08:10

VonC