- 리눅스 RSA 2048 공개키, 개인키 생성
- 리눅스 ssh-keygen
- /usr/bin/ssh-keygen
1 실행예시: 기본 실행
- 아무 옵션 없이 실행하면 대화식 진행 ( 기본 위치: ~/.ssh/id_rsa )
Console
Copy
[root@zetawiki ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
- → ↵ Enter
Console
Copy
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
- → 암호 2번 입력
- → SSH 자동로그인을 하려면 암호를 입력하지 않고 ↵ Enter 2번
Console
Copy
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
20:e9:b0:5b:5a:2b:ad:e8:4d:e4:b3:a0:32:49:2d:97 evan
The key's randomart image is:
+--[ RSA 2048]----+
| |
| . |
| . o . |
| + . . |
| o.= S |
| ooE . |
|.o*+o |
|=.+oo |
|=o.o |
+-----------------+
- 다음과 같이 개인키(id_rsa), 공개키(id_rsa.pub) 파일이 생성되었음
Console
Copy
[root@zetawiki ~]# ll ~/.ssh/id_rsa*
-rw------- 1 root root 1743 Sep 4 14:28 /root/.ssh/id_rsa
-rw-r--r-- 1 root root 390 Sep 4 14:28 /root/.ssh/id_rsa.pub
2 실행예시: -f 옵션

Console
Copy
root@zetawiki:~# ssh-keygen -f my-ssh-key.pem
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in my-ssh-key.pem.
Your public key has been saved in my-ssh-key.pem.pub.
The key fingerprint is:
ac:5b:fb:32:75:2c:43:25:2f:0e:a7:8e:33:a3:88:42 root@zetawiki
The key's randomart image is:
+--[ RSA 2048]----+
| |
| . . |
| + |
| .. + . |
| S* o |
| E .. = o |
|. .o.. + |
|.. . =o+. |
|o . ...+.+. |
+-----------------+
Console
Copy
root@zetawiki:~# ll my-ssh-key.pem*
-rw------- 1 root root 1679 Feb 9 14:33 my-ssh-key.pem
-rw-r--r-- 1 root root 395 Feb 9 14:33 my-ssh-key.pem.pub
3 실행예시: -lf 옵션

4 같이 보기
- 리눅스 known_hosts에서 호스트키 삭제
- 리눅스 RSA 개인키, 공개키 생성
- 리눅스 SSH 자동 로그인
- 리눅스 ssh-copy-id
- 리눅스 ssh-keyscan
- 리눅스 openssl
- ~/.ssh/id_rsa, id_rsa.pub
- RSA
5 참고 자료
편집자 John Jeong Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.