IT Knowledge/DevOps/images/github-ssh-diagram.svg
네, SSH 키를 새로 생성해서 등록하면 인증 문제를 해결할 수 있습니다. SSH 키를 사용하면 매번 토큰이나 비밀번호를 입력하지 않아도 되고, 인증 오류(403)도 대부분 해결됩니다12356.
아래는 SSH 키를 새로 생성하고 GitHub에 등록하는 전체 과정입니다.
1. SSH 키 생성
터미널(Git Bash 등)에서 아래 명령을 입력하세요.
이메일은 본인의 GitHub 계정 이메일로 입력합니다.
ssh-keygen -t ed25520 -C "mastav7@gmail.com"ssh-keygen -t rsa -b 4096 -C "mastav7@gmail.com"-
파일 저장 위치는 오늘날짜로 파일명 바꾼후 (Enter)으로 두세요.
-
passphrase(암호)는 원하면 입력, 아니면 Enter1.
ssh-add C:\Users\masta\.ssh\id_2504272. SSH 에이전트에 키 추가
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_250427`- 키 파일명이 다르면 해당 경로로 입력34.
3. 공개키 복사
bash
cat ~/.ssh/id_ed25519.pub
4. GitHub에 SSH 공개키 등록
-
GitHub 로그인
-
우측 상단 프로필 → Settings(설정)
-
좌측 메뉴에서 SSH and GPG keys 선택
-
New SSH key 클릭
-
Title(설명) 입력, Key란에 복사한 공개키 붙여넣기
5. SSH 연결 테스트
bash
ssh -T git@github.com
6. 원격 저장소 주소를 SSH로 변경
bash
git remote set-url origin git@github.com:aieeiee/fc_nocoderag.git
7. 다시 push 시도
bash
git push --set-upstream origin main
요약
-
SSH 키를 새로 생성해 GitHub에 등록하면 인증 문제(403 등)를 해결할 수 있습니다.
-
SSH 방식은 토큰 입력 없이도 안전하게 push/pull이 가능합니다.
궁금한 점 있으면 추가로 질문해 주세요!
Citations:
- https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- https://docs.github.com/ko/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
- https://dev.to/aditya8raj/setup-github-ssh-keys-for-linux-1hib
- https://www.youtube.com/watch?v=Z-HNfaYZ4Dc
- https://rfriend.tistory.com/603
- https://www.inmotionhosting.com/support/server/ssh/how-to-add-ssh-keys-to-your-github-account/
- https://docs.github.com/ko/enterprise-cloud@latest/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- https://docs.github.com/github-ae@latest/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
- https://kinsta.com/blog/generate-ssh-key/
- https://docs.github.com/en/authentication/connecting-to-github-with-ssh
- https://docs.github.com/ko/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
- https://stackoverflow.com/questions/3828823/how-to-generate-ssh-keys-for-github
- https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/GitHub-SSH-Key-Setup-Config-Ubuntu-Linux
- https://velog.io/@skyepodium/Github-SSH-Key-%EB%93%B1%EB%A1%9D%ED%95%98%EA%B8%B0
- https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
- https://devocean.sk.com/blog/techBoardDetail.do?ID=163311
- https://www.youtube.com/watch?v=iVJesFfzDGs
- https://www.lainyzine.com/ko/article/creating-ssh-key-for-github/
- https://github.com/github/docs/blob/main/content/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md
- https://docs.github.com/en/enterprise-server@3.12/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Perplexity로부터의 답변: pplx.ai/share