Linux password-free login via SSH

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.