"리눅스 ssh-keygen"의 두 판 사이의 차이

117번째 줄: 117번째 줄:
==참고==
==참고==
*http://ebroder.net/2010/01/18/ssh-keygen-randomart/
*http://ebroder.net/2010/01/18/ssh-keygen-randomart/
*https://en.wikipedia.org/wiki/Ssh-keygen


[[분류: ssh-keygen]]
[[분류: ssh-keygen]]

2017년 10월 6일 (금) 16:12 판

리눅스 RSA 2048 공개키, 개인키 생성
리눅스 ssh-keygen
/usr/bin/ssh-keygen

1 ssh-keygen

  • Unix SSH(Secure Shell) 프로토콜을 사용하기 위한 표준 컴포넌트
  • 키생성, 키관리, 인증키 변환을 위한 툴

2 문법

  • 문법
ssh-keygen [options]
  • 옵션
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 )
[root@zetawiki ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter
Enter passphrase (empty for no passphrase): 
Enter same passphrase again:
→ 암호 2번 입력
SSH 자동로그인을 하려면 암호를 입력하지 않고 Enter 2번
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) 파일이 생성되었음
[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 옵션

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 . ...+.+.      |
+-----------------+
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 옵션

6 같이 보기

7 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}