[AWS] EC2 Key-Pair PEM 생성

Linux/AWS 2023. 3. 14. 12:04 Posted by 생각하는로뎅
반응형

*** 신규 생성일때 ***

> cd /home/유저명/

* 필수

> mkdir .ssh
> mkdir .ssh
> chmod 700 .ssh
> touch .ssh/authorized_keys
> chmod 600 .ssh/authorized_keys


* 입력 안할시 엔터, 엔터, 엔터

> ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/mqm/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mqm/.ssh/id_rsa.
Your public key has been saved in /home/mqm/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+---[RSA 2048]----+
|    ..+B==.    oO|
|   . oo.XE.    ++|
|    .  =++B   +  |
|      . +=.* o   |
|       .So= o .  |
|        .+ O .   |
|          B =    |
|           o .   |
|          .      |
+----[SHA256]-----+

 

* key  복사

> cat id_rsa.pub > authorized_keys


* 클라이언트에서 private.pem 사용

> cat id_rsa
-----BEGIN RSA PRIVATE KEY-----
~~~
~~~

> cp id_rsa private.pem

 

반응형