受欢迎的博客标签

How to Setup SSH Passwordless Login Using SSH Keygen in 5 Easy Steps

Published

Step 1: Create Authentication SSH-Keygen Keys on – (192.168.0.12) ssh client

$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/tecmint/.ssh/id_rsa): [Press enter key]
Created directory '/home/tecmint/.ssh'.
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /home/tecmint/.ssh/id_rsa.
Your public key has been saved in /home/tecmint/.ssh/id_rsa.pub.
The key fingerprint is:
5f:ad:40:00:8a:d1:9b:99:b3:b0:f8:08:99:c3:ed:d3 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
|        ..oooE.++|
|         o. o.o  |
|          ..   . |
|         o  . . o|
|        S .  . + |
|       . .    . o|
|      . o o    ..|
|       + +       |
|        +.       |
+-----------------+

 

Step 2: Upload SSH Key to – 192.168.0.11 ssh server

$ ssh [email protected] "chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"

Step 3: Disable Password Authentication (Optional) ssh server

$ sudo vi /etc/ssh/sshd_config

 

$ sudo systemctl restart sshd

 

https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/