Jmnote bot (토론 | 기여) 잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==)) |
John Jeong (토론 | 기여) |
||
2번째 줄: | 2번째 줄: | ||
;리눅스 ssh-keygen | ;리눅스 ssh-keygen | ||
;/usr/bin/ssh-keygen | ;/usr/bin/ssh-keygen | ||
==ssh-keygen== | |||
*Unix [[SSH|SSH(Secure Shell)]] 프로토콜을 사용하기 위한 표준 컴포넌트 | |||
* 키생성, 키관리, 인증키 변환을 위한 툴 | |||
==문법== | |||
*문법 | |||
<source lang='bash'> | |||
ssh-keygen [options] | |||
</source> | |||
*옵션 | |||
{| class='wikitable' | |||
! ssh-keygen command options !! description | |||
|- | |||
| -b bits || Specifies the number of bits in the key to create. The minimum bit length is 768 bits and the default length is 2048 bits. | |||
|- | |||
| -C comment || Provides new comment. | |||
|- | |||
| -p || Requests changing the passphrase of a private key file instead of creating a new private key. | |||
|- | |||
| -t || Specifies the type of key to create. | |||
|- | |||
| -o || Use the new OpenSSH format. | |||
|- | |||
| -q || quiets ssh-keygen. It is used by the /etc/rc file while creating a new key. | |||
|- | |||
| -N || Provides a new Passphrase. | |||
|- | |||
| -F (or -B) || For ssh-keygen2, dumps the key's fingerprint in Bubble Babble format | |||
|} | |||
==실행예시: 기본 실행== | ==실행예시: 기본 실행== |
2017년 10월 6일 (금) 16:09 판
- 리눅스 RSA 2048 공개키, 개인키 생성
- 리눅스 ssh-keygen
- /usr/bin/ssh-keygen
1 ssh-keygen
- Unix SSH(Secure Shell) 프로토콜을 사용하기 위한 표준 컴포넌트
- 키생성, 키관리, 인증키 변환을 위한 툴
2 문법
- 문법
Bash
Copy
ssh-keygen [options]
- 옵션
ssh-keygen command options | description |
---|---|
-b bits | Specifies the number of bits in the key to create. The minimum bit length is 768 bits and the default length is 2048 bits. |
-C comment | Provides new comment. |
-p | Requests changing the passphrase of a private key file instead of creating a new private key. |
-t | Specifies the type of key to create. |
-o | Use the new OpenSSH format. |
-q | quiets ssh-keygen. It is used by the /etc/rc file while creating a new key. |
-N | Provides a new Passphrase. |
-F (or -B) | For ssh-keygen2, dumps the key's fingerprint in Bubble Babble format |
3 실행예시: 기본 실행
- 아무 옵션 없이 실행하면 대화식 진행 ( 기본 위치: ~/.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
4 실행예시: -f 옵션
ssh-keygen -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
5 실행예시: -lf 옵션
ssh-keygen -lf 문서를 참고하십시오.
6 같이 보기
- 리눅스 known_hosts에서 호스트키 삭제
- 리눅스 RSA 개인키, 공개키 생성
- 리눅스 SSH 자동 로그인
- 리눅스 ssh-copy-id
- 리눅스 ssh-keyscan
- 리눅스 openssl
- ~/.ssh/id_rsa, id_rsa.pub
- RSA
7 참고
편집자 John Jeong Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.