SSH Password-free login

Source: Internet
Author: User

Configuring SSH password-free login takes 3 steps:

1. Generate public and private keys

2. Import the public key to the authentication file, change the permissions

3. Testing


1. Generate public and private keys
Shell Code
  SSH-KEYGEN-T RSA

The default is to generate two files in the ~/.ssh directory:
Id_rsa: Private key
Id_rsa.pub: Public Key
2. Import the public key to the authentication file, change the permissions
2.1 Importing this machine
Shell Code
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys



2.2 Importing a server to password-free login

First copy the public key to the server


Shell Code
SCP ~/.ssh/id_rsa.pub [email protected]:/home/xxx/id_rsa.pub

The public key is then imported into the authentication file, and this step is performed on the server


Shell Code
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys



2.3 Changing permissions on the server


Shell Code
chmod ~/.ssh
chmod ~/.ssh/authorized_keys


3. Testing

SSH host, the first login may require a Yes confirmation, and then you can log in directly.

4, you can execute the command directly
SSH 10.207.139.62 ' hostname '

SSH Password-free login

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.