Study/GIT

[error-2] failed to authenticate via web browser

짬송 2021. 5. 4. 16:21

#3.4 Git and Github CLI

깃 환경설정 부분에서

[문제]

ah auth login 명령 입력 후에

failed to authenticate via web browser: Post "https://github.com/login/device/code": x509: certificate signed by unknown authority 오류 발생

[해결]

Git 서버 SSH공개키 만들기

cd ~/.ssh

ls

  • 디렉토리 또는 파일이 없다면

    ssh-keygen

    디렉토리:변경하지않고 써있는대로 두고 엔터

    암호: 입력하지않고 엔터두번

cat !/.ssh/id_rsa.pub

.pub파일의 내용을 복사하여 github-account settings - SSH and GPG keys 에서 SSH key를 등록한다.

그리고 다시 Window Terminal으로 돌아와서


? What account do you want to log into? GitHub.com ? How would you like to authenticate? Paste an authentication token

Tip: you can generate a Personal Access Token here https://github.com/settings/tokens The minimum required scopes are 'repo' and 'read:org'. ? Paste your authentication token: 토큰입력 ? Choose default git protocol SSH

*git token = https://github.com/settings/tokens


[ 결과]

gh config set -h github.com git_protocol ssh ✓ Configured git protocol ✓ Logged in as username

[참고]

https://git-scm.com/book/ko/v2/Git-서버-SSH-공개키-만들기

https://opentutorials.org/module/432/3742

https://brunch.co.kr/@anonymdevoo/10