SSH password-free login for non-root users

Source: Internet
Author: User

1. Create public key, public key
SSH-KEYGEN-T RSA
Ignore it out of any hint, cheerful all the way to the end of it.
2. Copy the public key id_rsa.pub to the/HOME/USERNAME/.SSH directory of the remote machine and name it Authorized_keys
Method 1: One step in place: SCP ~/.ssh/id_rsa.pub [Email Protected]:~/.ssh/authorized_keys

Method 2: Copy the SCP ~/.ssh/id_rsa.pub [email protected]:~
login ssh [email protected]
Additional Cat id_rsa.pub >> Ssh/authorized_keys
All kinds of means, with you happy, anyway, copy in the past is more than multiple remote host replication ~ If you are logged in the user and remote login user consistent, you can directly ssh hostname direct Landing, the following will not be seen.

3, resolve the local login user and remote login user inconsistent
Well, this is very tangled, although not to enter the password, but also have to SSH [email protected] to login, very uncomfortable, you understand. In fact, the solution is also very simple (but the colleague told me, Old face a red), modify the local login user's ~/.ssh/config file, if the wood has to build a bar , the content is as follows:
Host hostname
User Username
Host hostname2
User UserName2
In this way, the local and remote login user name inconsistency can also ssh hostname login.
Call it

SSH password-free login for non-root users

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.