github 의 계정이 N계일때 설정하는 방법입니다.
사전 준비
ssh-agent start - 윈도우 기본 OpenSSH를 활성화
- git-desktop을 이용한다고하면 ssh mode를 기본 탑재시스템 체크~
설정
# Key 생성 - id별로 C:Users\User\.ssh> ssh-keygen -t rsa -C "psmon@live.co.kr" -f "id_rsa_psmon" ssh-add id_rsa_psmon # id_rsa_psmon.pub 키 github 에 등록 # 복수개 설정 - C:Users\User\.ssh\config ## 계정 A Host psmon-github.com HostName github.com User git IdentityFile C:\Users\User\.ssh\id_rsa_psmon ## 계정 B Host some-github.com HostName github.com User git IdentityFile C:\Users\User\.ssh\id_rsa_some # TEST ssh -T psmon-github.com ssh -T some-github.com
- User(psmon) 은 주인장 컴퓨터의 샘플로 자신의 계정으로 사용
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. Hi psmon! You've successfully authenticated, but GitHub does not provide shell access.
- 위 메시지를 보면 성공
사용하기
- git@github.com →
git@some-github.com 으로 사용
ex> git@psmon-github.com:psmon/NetCoreLabs.git