서버

open ssh 설정

열공하는 엔지니어 2024. 2. 22. 09:11

서버1, Host name : centos1

서버2, Host name : centos2

root@centos1 poc]# ssh-keygen -t rsa

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

Enter same passphrase again: enter

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:Ee1q0XAZeJgB98aa4AkqXEymxQ2m1pqxJksgOj4Ef9Q root@centos1.demo.netapp.com

The key's randomart image is:

+---[RSA 2048]----+

| .*o ..+*.o |

| X. o .=+= |

|+= +o E .*+ |

|B.*o o o.=o |

|=Oo . o So |

|*+ . o |

|.o . |

| . |

| |

+----[SHA256]-----+

[root@centos1 poc]# ls /root/.ssh

id_rsa id_rsa.pub known_hosts

[root@centos2 poc]# ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa): enter

Created directory '/root/.ssh'.

Enter passphrase (empty for no passphrase): enter

Enter same passphrase again: enter

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:KFpO3OVVeFYBJ5Xd3Z6IzBZvzIlXiHUQ830OBeDz5FE root@centos2.demo.netapp.com

The key's randomart image is:

+---[RSA 2048]----+

| .BXX*E|

| .=o+=+*|

| . +oX Bo+|

| . . + . * & =o|

| = o S . o o .|

| = . |

| . . |

| |

| |

+----[SHA256]-----+

[root@centos1 .ssh]# scp id_rsa.pub centos2:/root/.ssh/authorized_keys

[root@centos1 .ssh]# ssh centos2

'서버' 카테고리의 다른 글

[리눅스] lvm 생성  (0) 2024.09.05
[리눅스] multipath alias 설정  (0) 2024.09.05
vi 자주 쓰는 명령어  (0) 2024.02.20
리눅스 멀티패스 (multipath.conf)  (0) 2024.02.20
리눅스에서 iscsi 설정하기  (0) 2024.02.20