SSH Login Principles

The client generates a pair of key and private key and stores the public key on the remote server. Each time you log in, the client sends a request to the remote server to a remote server to the client sends a random string, the client with his private key encryption, sent to the server, the server is decrypted with the public key, if successful, will prove that the user is credible, allow login shell directly, no longer requires a password

Procedure Log in over SSH

# generate keys on CD/Users/Administrator /. SSH SSH - the keygen # SCP id_ras copy the public key to the server. The pub [email protected]: / root/SSH SSH /config file Host testWeb // HostName 59.110.45.160 // remote Host IP User root // login User name # server CD Cat id_rsa.pub >> authorized_keys # restart SSH systemctl Restart SSHD or run the ssh-copy-id -i [email protected] command to skip server stepsCopy the code