ssh 공개키 설정
ssh 공개키 설정
[root@localhost ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
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:
SHA256:lGaKuiZLsESGpxseXBqNNbhvO47IJqX0gwaFeTZVxrI root@rac1
The key's randomart image is:
+---[RSA 2048]----+
| .o oo |
|..+ +.. . |
|.Bo+ o = |
|*+O E. = |
|+O... . S |
|==o+ |
|=== . |
|B+o* |
|**o.o |
+----[SHA256]-----+
[root@localhost ~]#
[root@localhost ~]# cd .ssh
[root@localhost .ssh]# ls
id_rsa id_rsa.pub
[root@localhost .ssh]# ll
합계 8
-rw------- 1 root root 1679 4월 26 16:45 id_rsa
-rw-r--r-- 1 root root 391 4월 26 16:45 id_rsa.pub
[root@localhost .ssh]# cp id_rsa.pub authorized_keys
[root@localhost .ssh]# ll
합계 12
-rw-r--r-- 1 root root 391 4월 26 17:34 authorized_keys
-rw------- 1 root root 1679 4월 26 16:45 id_rsa
-rw-r--r-- 1 root root 391 4월 26 16:45 id_rsa.pub
[root@localhost .ssh]#
**접속할서버에 id_rsa* 업로드