Step1. Generate a key on Deploynode
My current user is ceph, executing commands in the. ssh/directory ssh-keygen -t RSA
[email protected]. ssh]$ lsceph.log config id_rsa id_rsa.pub known_hosts
will find two files generated under this directory, Id_rsa, Id_rsa.pub
step2. Copy the Id_rsa.pub to the. ssh/directory of the user directory under the other node and execute the command
Cat id_rsa.pub >> authorized_keyssudo service sshd restart
Note: This time I copied the SZ command to download to the local, and then through the RZ command to upload to the other server, this is to do some testing.
Step3. Finally, access via the Deploynode node can be accessed without a password.
You can see that the user has switched to Mdsnode.
Copies of Id_rsa.pub are copied by Ssh-copy-id or SCP commands, but passwords are still required for real login.
Later looked at the Authorized_keys file, just guess some things, is the end of the Authorized_keys file before
is not [email protected], but the relevant information of localhost, I understand this file is that this public key belongs to
Deploynode the Ceph user under the machine. When this user accesses the machine with SSH, they can login without a password, if the information here
not [email protected], of course, can not play the effect of no password login.
Linux password-free login via SSH