SSH 등록 + GitHub에 등록
① SSH key들이 있는지 확인
$ ls -al ~/.ssh
위 코드를 입력하여 ssh가 있는지 확인. 없으면 다음 단계로
② 새로운 SSH key 생성
$ ssh-keygen -t rsa -b 4096 -C "이메일주소@땡땡땡.컴"
위와 같이 입력하면 아래와 같은 글이 나온다.
Enter passphrase (empty for no passphrase): Enter same passphrase again:
(나는 그냥 Enter 누름)
입력을 마치고 나면 아래와 같이 글이 나온다.
Your identification has been saved in /Users/username/.ssh/id_rsa. Your public key has been saved in /Users/username/.ssh/id_rsa.pub. The key fingerprint is: 뭔가 복잡한 알파벳들이 쓰여있음 = 이메일주소@땡땡땡.컴
The key's randomart image is:
+--[ RSA 2048]----+
| o*.o.* o |
| oE * = % |
| * . * = |
| . .. o . |
| . S. |
| . |
| |
| |
| |
+-----[SHA256]----+
② 생성된 key를 ssh-agent에 추가
$ eval $(ssh-agent -s)
위와 같이 입력하면 다음과 같이 나온다.
Agent pid (숫자나옴)
위의 key를 ssh-agent에 추가해준다.
$ ssh-add ~/.ssh/id_rsa
③ 생성된 key를 확인하고 GitHub에 등록
$ gedit id_rea.pub
터미널 창에 위 문장을 입력해서 나오는 문자들을 복사하여 GitHub로 옮겨준다.
계정 아이콘을 누른 후
Settings - SSH and GPG keys - New SSH key 를 눌러 새로 등록해주면 된다.
참고 URL
https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent 깃허브에 나와 있는 설명
https://adamdehaven.com/blog/how-to-generate-an-ssh-key-and-add-your-public-key-to-the-server-for-authentication/ SSH를 생성하는 설명글
https://jdm.kr/blog/212 리눅스 SSH 사용법
댓글
댓글 쓰기