티스토리 뷰

Backend/꾸준히 TIL

git ssh 유저 변경하는 방법

개발하는 후딘 2022. 8. 13. 20:38
728x90
반응형

[문제사항]

- ssh 키를 새로 만들었습니다.

< 관련포스트: ssh 키 만드는 방법 >

 

SSH 프로토콜을 알아보자

참고자료 SSH 는 무엇일까? [네트워크] SSH란? - 하나몬 SSH이란? (What is SSH?) 시큐어 셀(Secure SHell, SSH)은 네트워크 상의 다른 컴퓨터에 로그인하거나 원격 시스템에서 명령을 실행하고 다른 시스템으

ek12mv2.tistory.com


- Personal Access Token 을 추가했습니다.

< 관련포스트: User Access Token 추가하는  방법 >

 

git cli 명령어 에러 해결 - remote: Support for password authentication was removed on

[문제내용] $ git push -u origin main Username for 'https://github.com': Eun-Kang-Choi Password for 'https://Eun-Kang-Choi@github.com': remote: Support for password authentication was removed on Augu..

ek12mv2.tistory.com

 

- Private 래포지토리를 Collaborate하여, 레포지토리 접근권한도 얻었습니다.

 

- git config --global user.email/user.name 도 collaborator 계정으로 했습니다.

 < 관련포스트:  git config --global user.email / user.name 등록하는 명령어 >

 

git config

참고자료 git config 설정 확인 및 변경하기 git을 사용하는 경우 config 설정에 대한 내용을 볼 필요가 있습니다. 예를들어 사용자 이름이나 email 등을 확인할 수 도 있겠죠 webisfree.com 해당 셸에 git 사

ek12mv2.tistory.com


그런데! 제 아이맥 로컬에서 private 래포지토리를 클론하지 못했습니다.

git clone git@github.com:loveAlakazam/래포지토리.git
Cloning into '래포지토리명'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

아래의 메시지는 ssh에 로그인된 계정이 비공개 래포지토리에 대한 접근권한이 없다 의미의 메시지입니다.

혹시 ssh에서 로그인한 계정은 전혀다른 계정인가 예상했습니다.


[해결방법]

원인은 ssh계정으로 로그인된 계정이 collaborator 계정과 달랐기 때문입니다. 즉 제 3자의 계정이었습니다!

ssh 로 설정된 계정 확인이 필요합니다.

(1) 현재 ssh에 로그인된 github 계정을 확인해봅니다.

$ ssh -T git@github.com

Hi silver-choi! You've successfully authenticated, but GitHub does not provide shell access.

결과는 silver-choi 라는 엉뚱한 사람(이전 회사계정) 이 ssh 인증로그인이 되어있었습니다 -_-;

 

(2) ssh-add 로 새로 만든 키를 다시 등록 합니다.

$ ssh-add ~/.ssh/id_ed25519

 

(3) 등록후 다시 로그인된 깃헙 계정을 확인해봤습니다.

$ ssh -T git@github.com

Hi eunkangchoi! You've successfully authenticated, but GitHub does not provide shell access.

 

그리고 다시 래포지토리를 클론했더니 정상적으로 되었습니다.

728x90
반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함