Configure ssh password-less login and ssh password login
Wanshi is only available after dual-host mutual configuration several times. I can't remember the direction, but I can't remember it here.
A wants to link B, and A gives B its own public key
1
Zxw @ hostUbuntu1 :~ $ Ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/zxw/. ssh/id_rsa ):
Enter passphrase (empty for no passphrase ):
Enter same passphrase again:
Your identification has been saved in/home/zxw/. ssh/id_rsa.
Your public key has been saved in/home/zxw/. ssh/id_rsa.pub.
The key fingerprint is:
F0: c0: a1: 2b: 67: 4a: 23: 77: 9a: 17: 0c: 23: 4d: 47: 25: 74 zxw @ hostUbuntu1
The key's randomart image is:
+ -- [RSA 2048] ---- +
|. O =. E |
| O. =. |
|. +. + |
|. +. + |
|. = B S |
| + X. |
| +. |
|. |
|
+ ----------------- +
2
Zxw @ hostUbuntu1 :~ $ Scp ~ /. Ssh/id_rsa.pub ip:. ssh/id_rsa_ppas1.pub
3
Zxw @ hostUbuntu2 :~ $ Touch. ssh/authorized_keys
4
Zxw @ hostUbuntu2 :~ $ Cat. ssh/id_rsa_11.pub>. ssh/authorized_keys
You can log on to hostUbuntu2 from hostUbuntu1 without a password.
-----------------
Please refer to the following source for reprinting:
Blog.csdn.net/beiigang