Summary ssh and scp between some common devices can save a lot of time without entering a password. Generate a key first. check whether a local key exists. If yes, do not generate the key.
Ssh and scp between some common devices can save a lot of time without entering a password.
Generate key
Check whether the local device has a key. If yes, do not generate the key. Otherwise, the previously connected devices will be affected.
Ls ~ /. Ssh/id_rsa.pub
If no, use ssh-key-gen to create the public key and key on the local host.
Ssh-keygen-t rsa
Press enter
Copy the public key to the remote host.
Ssh-copy-id-I ~ /. Ssh/id_rsa.pub root@192.168.0.3
Directly log on to the remote host
Ssh 192.168.0.3
Log on directly without a password.
Password is still required for ssh local machine from 192.168.0.3,
Follow the steps above to operate on 192.168.0.3, or omit the password.