Step 1
[root@host1 ]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
dd:1c:62:5c:d0:87:39:f0:29:18:a0:f0:15:d2:a4:32 root@host1
The key's randomart image is:
+--[ RSA 2048]----+
| . .o=o. o+.o |
| o =. + o=.. |
| E + . = +o |
| o o = . |
| S . o |
| |
| |
| |
| |
+-----------------+
Step 2
[root@host1]# ssh-copy-id -i ~/.ssh/id_rsa.pub host2
Step3.
[root@host1 ]# ssh host2
[root@host1 ]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
dd:1c:62:5c:d0:87:39:f0:29:18:a0:f0:15:d2:a4:32 root@host1
The key's randomart image is:
+--[ RSA 2048]----+
| . .o=o. o+.o |
| o =. + o=.. |
| E + . = +o |
| o o = . |
| S . o |
| |
| |
| |
| |
+-----------------+
Step 2
[root@host1]# ssh-copy-id -i ~/.ssh/id_rsa.pub host2
Step3.
[root@host1 ]# ssh host2
No comments:
Post a Comment