program tip

Git 푸시 결과 "인증 실패"가 발생합니다.

radiobox 2020. 10. 4. 10:49
반응형

Git 푸시 결과 "인증 실패"가 발생합니다.


나는 잠시 동안 Github에서를 사용하고 내가 함께 잘왔다 git add, git commit그리고 git push지금까지 아무런 문제. 갑자기 다음과 같은 오류가 발생합니다.

치명적 : 인증 실패

터미널에서 리포지토리를 복제하고 파일 작업을 한 다음 git add커밋 로그에 파일을 추가하는 데 사용 했으며했을 때 git commit제대로 작동했습니다. 마지막으로 git push사용자 이름과 비밀번호를 묻습니다. 나는 그것들을 올바르게 넣었고 이것을 할 때마다 같은 오류를 말합니다.

누구든지이 문제의 원인이 무엇이며 어떻게 해결할 수 있는지 알고 있습니까?

의 내용 .git/config은 다음 같습니다.

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = http://www.github.com/######/Random-Python-Tests
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[user]
        name = #####
        email = ############

Github 계정에서 이중 인증을 활성화 한 경우 계정 비밀번호를 사용하여 HTTPS를 통해 푸시 할 수 없습니다. 대신 개인 액세스 토큰을 생성해야합니다. 이는 Github 계정의 애플리케이션 설정에서 수행 할 수 있습니다. 이 토큰을 암호로 사용하면 HTTPS를 통해 원격 저장소로 푸시 할 수 있습니다. 평소처럼 사용자 이름을 사용하십시오.

https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

https로 설정된 경우 저장소의 원본을 업데이트해야 할 수도 있습니다.

git remote -v 
git remote remove origin 
git remote add origin git@github.com:user/repo.git  

저장된 자격 증명을 편집하거나 제거하려면 다음 단계를 시도하십시오.

  1. 시작 클릭
  2. 유형 : Credential Manager (Windows 10의 경우 "시작-> 설정"에 있습니다. 그런 다음 "Credential Manager"를 검색하십시오)
  3. 참고 항목 Windows Credentials Manager바로 가기를 응용 프로그램을 두 번 클릭하여 엽니 다.
  4. 앱이 열리면 Windows Credentials탭을 클릭합니다 .
  5. 제거 / 업데이트하려는 자격 증명을 찾으면 "git :"로 시작하고 "ada :"로 시작할 수 있습니다.
  6. 자격 증명 항목을 클릭하면 항목의 세부 정보보기가 열립니다.
  7. 필요에 따라 편집 또는 제거를 클릭하고 확인합니다.
  8. 필요에 따라 씻고 헹구고 반복하십시오.

여기에 이미지 설명 입력


이것은 나를 위해 일했으며 내 자격 증명도 기억합니다.

  1. gitbash 실행

  2. repo 디렉토리를 가리 킵니다.

  3. 운영 git config --global credential.helper wincred


먼저 적절한 URL을 사용할 수 있습니다.

git remote set-url origin https://github.com/zkirkland/Random-Python-Tests.git

그런 다음 이전에 작동하고 사용자 이름을 요청하지 않았다면 여기에 설명 된$HOME/.netrc 대로 자격 증명 (로그인 / 비밀번호)을 파일에 저장했기 때문일 것 입니다. 이러한 설정을 다시 확인하고 프록시가있는 경우 프록시가 변경되지 않았는지 확인할 수 있습니다.

그래도 작동하지 않으면 ssh URL로 전환 할 수 있습니다.

git remote set-url origin git@github.com:zkirkland/Random-Python-Tests.git

그러나 이는 계정 설정 에 SSH 공개 키를 게시했음을 의미합니다 .


최근에 git 계정의 비밀번호를 변경했을 수 있습니다. git pushwith -u옵션을 시도해 볼 수 있습니다.

git push -u origin branch_name_that_you_want_to_push

위의 명령을 실행 한 후 업데이트 된 암호를 제공하는 암호를 묻습니다.

그것이 당신을 도울 수 있기를 바랍니다


기본적으로 내 자격 증명이 만료되었으며 위의 문제에 직면했습니다.

다음 2 명령은 나를 도왔습니다.

git config --global --unset credential.helper

git config credential.helper store

다음에 푸시를 시도 할 때 자격 증명을 요청합니다.

사용자 이름 및 암호의 보안 및 비보안 저장에 대한 자세한 내용은 아래 지침을 따르십시오.

https://git-scm.com/docs/git-credential-store

https://git-scm.com/docs/git-credential-cache


올바른 비밀번호와 사용자 이름을 입력했을 때 인증 오류 문제가 발견되면 git 문제입니다. 컴퓨터에 git을 설치할 때이 문제를 해결하려면 git credential manager 활성화를 선택 취소하십시오.여기에 이미지 설명 입력


어떤 이유로 GitHub는 URL에 하위 도메인 www가 없을 것으로 예상하고 있다고 생각합니다. 내가 사용할 때 (예 :)

git remote set-url origin https://www.github.com/name/repo.git

다음 메시지를 제공합니다.

remote: Anonymous access to name/repo.git denied
fatal: Authentication failed for https://www.github.com/name/repo.git

그러나 내가 사용하면

git remote set-url origin https://github.com/name/repo.git

완벽하게 잘 작동합니다. 나에게 너무 의미가 없습니다 ...하지만 GitHub 저장소의 원격 URL에 www를 넣지 않는 것을 기억하십시오.

또한 GitHub 저장소 웹 페이지에 제공된 복제 URL에는 www가 포함되어 있지 않습니다.


Hi, I was getting the same error i tried all the solutions whichever mentioned in this page, but didn't work. Finally, i found the solution, So thought of posting it. Please correct me if i am wrong anywhere. These kinds of error comes if sometimes your system password has changed recently anytime. It will try to validate from old password. So, Follow these steps:

  1. Go to control panel
  2. Click on User accounts
  3. Under Credentials manager
  4. Go to Manage windows credentials
  5. Go to Generic credentials
  6. Expand git server tab
  7. click on Remove from vault

    • Also you can click edit and change your password stored here directly.

I've ran into "$ git fetch fatal: Authentication failed for 'http://...." after my windows password has expired and was changed. Multiple fetches, reboot and even reinstall of git with windows credential manager didn't help.

Surprisingly the right answer somewhere here in comments but not in answers (and some of them are really weird!). You need to go to Control panel -> Credential Manager / Windows Credentials and update you password for git:http://yourrepoaddress


I'm not really sure what I did to get this error, but doing:

git remote set-url origin https://...

didn't work for me. However:

git remote set-url origin git@bitbucket.org:user/repo

somehow worked.


I had the same problem. I set url in that way:

git remote set-url origin https://github.com/zkirkland/Random-Python-Tests.git

I also removed from config file this entry: askpass = /bin/echo. Then "git push" asked me for username and password and this time it worked.


Just from your .config file change:

url = http://www.github.com/###user###/Random-Python-Tests

To:

url = http://###user###@github.com/###user###/Random-Python-Tests


If you are on windows and trying to push to a windows server which has domain users working as repository users (TFS), try getting into TFS URL (i.e. http:\\tfs) with IE. enter your domain account credentials and let the page appear.

CAUTION only use INTERNET EXPLORER! other browsers wont change your system credentials.

Now go to git bash and change your remote user for the repository like below :

git config user.name "domainName\userName"

And done, now you can push!


For me, I forgot that I had changed the password on Github.com, and my keychain for shell authentication never updated to that new password. Deleting everything git from my keychain and then re-running the git request helped solve the issue, prompting me again for the new password.


Just to chime in here, what fixed the issue for me was I simply canceled out of the initial prompt, the ssh one opened up with my bitbucket account, I entered the password there and everything worked as expected.


I was facing the same issue on windows. Most of the time I normally face the issue due to using multiple git accounts. If you are on windows, please do open the terminal as an administrator and try running the commands again. Make sure that you have the administrator access rights.


I also ran into the error (that's why I am landed here), but none of the suggestions worked for me. This was my very first time I try to deploy local Git to azure. When I got this error, I reset my credentials (by clicking the link in Azure) after a few tries. The problem is that at this point it tells me my user name is already taken, so I also changed my user name to another one. In the end, I manually deleted the .git folder on my local drive, and redeployed it without problem.


Problem Statement: "git fatal authentication failed". I am using bitbucket.

Solution: I simply deleted the user from using access management of bitbucket and then added the same user. The .gitconfig file is simple

[user]
    name = BlaBla
    email = blabla@gmail.com

[push]
    default = simple

with correct credentials if the problem prevails

if your using androidstudio 2.1 beta then its bug , upgrade to beta 2 (3 mb update file) , this worked for me


Make sure you have WRITE permission to push.

read ***write*** admin 

Make sure that your ssh key is added to your current ssh session.

  1. Copy the output of cat ~/.ssh/id_rsa.pub to your GitHub settings under SSH and GPG keys.

  2. Update your current ssh session with ssh-add ~/.ssh/id_rsa.pub

I am using Windows Powershell with Openssh installed.


If you have enabled the two-factor authentication on you Github account, then sign in to your GitHub account and go to: https://github.com/settings/tokens/new to generate new access token, copy that token and paste as a password for authentication in terminal.


in Android studio canary build 3.1+, if you are using Android studio git tool, than you can use following :

  • Click on Android Studio
  • Click on Preferences...
  • GO in VersionControl -> Github
  • Here Change Auth type to Password
  • This step will require you to enter login and password. Enter you github user name a s login and github password as password.
  • Click on Test Button.

If connection is successful , than you are done and you can use android studio github UI client.


If you are using ssh and cloned with https this will not work. Clone with ssh and then push and pulls should work as expected!


In case this is tangentially helpful, since this question is now a top hit for http authentication problems with git: Windows Credential Manager had stored my password correctly, and since I was using Git LFS I configured an http URL instead of the usual ssh://.

내 문제는 내 회사 암호 정책이 계정 암호를 강제로 변경했지만 저장된 자격 증명을 업데이트하지 않았다는 것입니다 (항상 ssh 키를 사용하기 때문에).

Wincred GUI에서 직접 암호를 업데이트하기 만하면 git:https://<your-url>됩니다. 항목을 찾으십시오 .

참고 URL : https://stackoverflow.com/questions/17659206/git-push-results-in-authentication-failed

반응형