demand
I use CENTOS7 develop debugging, so regular application deployment and maintenance connected to the server via SSH.
So, there is an urgent need for a way to password-free log in to the cloud server, and available everywhere.
Program
The use of "public private" way to authenticate ssh login
principle
-
RSA creates a pair of public and private key on the client (public key file: ~ / .ssh / id_rsa.pub; private key file: ~ / .ssh / id_rsa)
-
The public key to the server (~ / .ssh / authorized_keys), retained their own private good
-
When ssh login, ssh program will send a public key and a private key on the server to do the match, if the match is successful login is successful
(1) for generating a public and private key RSA
Then, move the mouse in the blank area free, puttygen.exe generates a random number when the mouse is used to generate the RSA public and private key.
Generated in the previous step Copy all Public Key, then placed server ~ / .ssh / authorized_keys file, a Public Key own line, as shown below:
mkdir -p /root/.ssh -p cd /root/.ssh vi authorized_keys
Click puttygen.exe of the Save Private Key , RSA private key will be saved as a file