github의 인증 방식
- id / pw
: 2021년 8월 이후로 password를 통한 인증이 안되도록 바뀜
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.'
- Personal Access Key (Token-Based Authentication)
: 깃허브 계정 설정 > Developer settings에서 생성하는 개발자용 토큰
: 비밀번호 대신 사용 가능
: https://2mukee.tistory.com/239
- SSH Key
: 깃을 실행할 클라이언트 호스트의 SSH Key를 생성하고, 해당 키의 공개키를 깃허브 계정에 공개키를 등록하여 제어
: 2021년 11월 이후로는 DSA에 대한 지원을 끊고 RSA로만 지원
: https://2mukee.tistory.com/248
- OAuth
: 깃허브 계정 인증을 구글 등 서비스 아이디를 통해 인증
repo 주소에 id와 token키 입력
git clone https://<ID>:<TOKEN>@myrepo.github.com/coolproject.git
: 토큰 키가 그대로 노출될 수 있어 위험한 방법
git credential / cache
git config --global credential.helper cache
: 인증했던 ID와 TOKEN을 메모리에 일정시간 저장하여 입력 횟수를 줄이는 방법.
: 기본적으로 15분 동안 유지
: https://git-scm.com/docs/git-credential-cache
- 연장
// 단위는 초 단위. 기본값 900. 최대값은 실험 필요
git config credential.helper 'cache --timeout=300'
git credential / store
git config --global credential.helper store
: 인증했던 ID와 TOKEN을 디스크에 저장.
: 명령 실행 후 로그인 하면 정보는 자동으로 업데이트 됨
: 로그인 정보는 ~/.git-credentials에 저장 됨
: 파일에 로그인 정보가 남기 때문에 보안적으로 좋은 방법은 아님
git credentail / keychain
# for windows
git config --global credential.helper wincred
# for Mac
git config --global credential.helper osxkeychain
# for ubuntu
sudo apt install libsecret-1-0 libsecret-1-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper \
/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
: OS나 라이브러리에서 지원하는 키체인을 통해 로그인 정보를 안전하게 저장하는 방법
git 설정 상태 확인
# local 설정
git config --list
# Global 설정
git config --global --list
: git에 대한 설정을 확인할 수 있음
: local 설정은 .git 파일에 대한 설정, global 설정은 시스템 전역적인 설정
Reference
Git, Pull/Push할 때 id password 묻지 않게 하기
배경
pinedance.github.io
[Github]HTTPS vs SSH 그리고 SSL
어제 있었던 이슈를 다시 회고해보자.. 어제 마주쳤던 문구 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.' 그리고 Github에서는 어제 문구와 같이 더
algoroot.tistory.com
OAuth 앱 권한 부여 - GitHub Docs
다른 사용자가 OAuth app에 권한을 부여하도록 설정할 수 있습니다.
docs.github.com
Git - Credential 저장소
실제로는 어떻게 동작하는지 살펴보자. Git의 Credential-Helper 시스템의 기본 명령은 git credential 이다. 이 명령이 하위 명령이나 옵션, 표준입력으로 필요한 정보를 입력받아 전달한다. 이 과정은 예
git-scm.com
'Devops > Git' 카테고리의 다른 글
error: Your local changes to the following files would be overwritten by merge (0) | 2023.08.25 |
---|---|
git-flow에 대해 알아보자 (0) | 2023.08.19 |
좋은 Git 커밋 메시지 작성 방법 (0) | 2023.05.29 |
[git] merge VS rebase (0) | 2023.05.29 |
삭제된 git stash 복구하기 (0) | 2023.01.03 |