본문 바로가기
개발/Trouble Shooting

[GIT] GITHUB 푸시 권한문제

by [시지프] 2025. 4. 11.
728x90

깃허브에서 소스를 다운 받을때 필요한 url
gihub 에서 소스 받기

 

  • 소스를 푸시하려는데 에러 발생!
Pushing to https://github.com/generlists/shortform-play
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/generlists/shortform-play/'
Pushing to https://github.com/generlists/shortform-play
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/generlists/shortform-play/'
Pushing to https://github.com/generlists/shortform-play
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/generlists/shortform-play/'
Pushing to https://github.com/generlists/shortform-play
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/generlists/shortform-play/'
Completed with errors, see above

 

위 에러는 패스워드 방식의 로그인이  보안상 삭제되었다는 것이다.

 

아래 단계로 코드를 푸시하면 된다.


 방법 1: 토큰(PAT)을 사용한 HTTPS 인증

  1.  GitHub에서 토큰 발급 페이지로 이동
  2. Fine-grained token 또는 Classic token 중 하나 선택
  3. 권한은 최소한 아래 설정:
    1. epo (모든 repository 접근)
    2. write:packages (패키지 업로드 시 필요)
  4. 4. 토큰을 복사해 둔다.  이후 비밀번호 대신 사용(저장해 놓음)

 

  • 다음 아래 명령어로 실행

 

git remote set-url origin https://<USERNAME>:<TOKEN>@github.com/<USERNAME>/<REPO>.git
  • 리파지토리 푸시

 

git push origin main

 

방법 2: SSH 방식으로 전환 (MAC에서)

 

1. 로컬 SSH 키 생성

ssh-keygen -t ed25519 -C "your_email@example.com"

 

2. GitHub에 공개 키 등록

 

https://github.com/settings/keys

 

그러나 아래 에러가 추가로 나왔다.

error: No such remote 'origin'

 

origin 리모트 등록하기

 

git remote add origin https://github.com/generlists/shortform-play.git

 

리모트 확인

git remote -v

 

다음 푸시 

git push origin main

 

 

이슈 해결!

 


하단푸터
숏폼플레이 다운로드 부탁드려요 ^^

 

728x90