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"
  • 구형 시스템이면 사용136.
ssh-keygen -t rsa -b 4096 -C "mastav7@gmail.com"
  • 파일 저장 위치는 오늘날짜로 파일명 바꾼후 (Enter)으로 두세요.

  • passphrase(암호)는 원하면 입력, 아니면 Enter1.

ssh-add C:\Users\masta\.ssh\id_250427

2. SSH 에이전트에 키 추가

eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_250427`
  • 키 파일명이 다르면 해당 경로로 입력34.

3. 공개키 복사

bash

cat ~/.ssh/id_ed25519.pub

  • 출력된 내용을 모두 복사356.

4. GitHub에 SSH 공개키 등록

  1. GitHub 로그인

  2. 우측 상단 프로필 → Settings(설정)

  3. 좌측 메뉴에서 SSH and GPG keys 선택

  4. New SSH key 클릭

  5. Title(설명) 입력, Key란에 복사한 공개키 붙여넣기

  6. Add SSH key 클릭2356

5. SSH 연결 테스트

bash

ssh -T git@github.com

  • “You’ve successfully authenticated…” 메시지가 나오면 성공35.

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:

  1. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
  2. https://docs.github.com/ko/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
  3. https://dev.to/aditya8raj/setup-github-ssh-keys-for-linux-1hib
  4. https://www.youtube.com/watch?v=Z-HNfaYZ4Dc
  5. https://rfriend.tistory.com/603
  6. https://www.inmotionhosting.com/support/server/ssh/how-to-add-ssh-keys-to-your-github-account/
  7. 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
  8. https://docs.github.com/github-ae@latest/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
  9. https://kinsta.com/blog/generate-ssh-key/
  10. https://docs.github.com/en/authentication/connecting-to-github-with-ssh
  11. https://docs.github.com/ko/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
  12. https://stackoverflow.com/questions/3828823/how-to-generate-ssh-keys-for-github
  13. https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/GitHub-SSH-Key-Setup-Config-Ubuntu-Linux
  14. https://velog.io/@skyepodium/Github-SSH-Key-%EB%93%B1%EB%A1%9D%ED%95%98%EA%B8%B0
  15. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
  16. https://devocean.sk.com/blog/techBoardDetail.do?ID=163311
  17. https://www.youtube.com/watch?v=iVJesFfzDGs
  18. https://www.lainyzine.com/ko/article/creating-ssh-key-for-github/
  19. 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
  20. 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