All operations are OK on the client side.
The general idea is as follows: On the client side, generate a public-private key pair that uploads the public key to the ~/.ssh/of the specified user on the server (for example, a)
Modify the next file, the directory permissions are OK, so you can from the client to the server to exempt the key,
If you still want to serve, the client is exempt from the key, and in turn, it can.
For example, client clients want to exempt the key to server-side user A
Client ip:192.168.200.157
Server ip:192.168.200.156
1.ssh-keygen//Generate public and private keys, press the ENTER key all the way.
The generated. SSH directory permission requirements are: 700
The. Ssh/id_rsa (private key) permission requirement is: 600, user and user group requirements for the client's own
The. ssh/id_rsa.pub (public key) permission requirement is: 644, user and user group requirements for the client's own
2.SCP ~/.ssh/id_rsa.pub [Email protected]:~/authorized_keys (Transfer the public key to the server, named Authorized_keys)
Enter the password for a
SSH [email protected]//a user who is connected remotely to the server.
Enter the password for a
mkdir. SSH && chmod. ssh
CP ~/authorized_keys. ssh/
cd. SSH && chmod 644 Authorized_keys
Authorized_keys users and user groups to be a
At this point, the client connects to server user A without entering a password.
This article is from the "12208412" blog, please be sure to keep this source http://12218412.blog.51cto.com/12208412/1872020
SSH configuration Client-free key to server