GitHub - Personal Access Token

아이디/패스워드 인증의 종말

아이디/패스워드 인증을 그만 쓰라는 메세지를 계속 봐오면서도 넘기고 있었다. 근데 어제 푸쉬를 때리니 2021-8-13일을 기준으로 패스워드 인증 지원이 사라졌다고 한다.

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/taroguru/blog.git/': The requested URL returned error: 403

이제는 미룰 수 없다. 액세스 토큰을 받자.

암호인증, 왜 안됨?

얼핏 생각하기에 토큰을 쓰나 암호를 쓰나 길이를 제외하고는 문자열 하나라는 점에서 큰 차이가 없지 않나 하는 생각도 들었는데, 복수의 사이트를 동일한 암호로 설정한 경우에 대한 보안이 주요 골자인 것 같다. 암호를 주기적으로 바꾸고, 사이트마다 다르게 쓰고,MFA까지 걸면(혹은 MFA만 걸어도) 안전하지만 그렇지 않은 경우가 많아서 GitHub 전체 정책으로 막은 듯. 아래는 깃헙블로그 발췌[1].

In recent years, GitHub customers have benefited from a number of security enhancements to GitHub.com, such as two-factor authentication, sign-in alerts, verified devices, preventing the use of compromised passwords, and WebAuthn support. These features make it more difficult for an attacker to take a password that’s been reused across multiple websites and use it to try to gain access to your GitHub account. Despite these improvements, for historical reasons customers without two-factor authentication enabled have been able to continue to authenticate Git and API operations using only their GitHub username and password.

Personal Access Token으로 GitHub 인증 해보자

아래 링크에서 친절하게 설명하고 있다. https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

맥에서 안되면?

키체인에 아이디/암호가 등록되어서 그렇다. 키체인의 비밀번호를 토큰으로 바꾸자. https://curryyou.tistory.com/403

Sourcetree 연동은?

요롷게 땡기면 된다. https://velog.io/@boms2/GitMac-Sourcetree%EC%97%90%EC%84%9C-Github-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-Private-Repo-Organizations-%ED%8F%AC%ED%95%A8

참조

  1. https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations
  2. https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token
  3. https://velog.io/@boms2/GitMac-Sourcetree%EC%97%90%EC%84%9C-Github-%EC%97%B0%EB%8F%99%ED%95%98%EA%B8%B0-Private-Repo-Organizations-%ED%8F%AC%ED%95%A8