Password-free SSH Logon

Source: Internet
Author: User

Password-free SSH Logon

My virtual machine:

192.168.91.130 test1

192.168.91.131 test2

192.168.91.132 test3

1. First generate a key pair on test1

The. shh/file will be generated later, enter. shh/, and copy id_rsa.pub

 

Id_rsa is the private key and id_rsa.pub is the public key.

 

2. Put the Public Key authorized_keys (id_rsa.pub) in/root/. ssh/authorized_keys of test2 and test3.

 

3. At this time, the authorized_keys file will be available on test2 and test3. Note that (the directory. shh/needs to be created on test2 and test3 /)

In this case, you need to set the permissions to go to test2 and test3 respectively:

Chmod 700. shh/

Chmod 600. shh/authorized_keys

Note: After the permission settings are completed, Restart sshd.

/Etc/init. d/sshd restart

4. Now it's over. You can connect test2 and test3 through test1.

Note the following points:

1. Restart sshd after setting permissions.

2. enter a password for the first connection. Don't worry,

3. If the VM is reconnected without restarting, you may need to enter a password. In this case, restart the VM to reconnect.

You may also like the following SSH-related articles. For details, refer:

Complete SSH service configuration and troubleshooting in Ubuntu

How to install Samba and SSH server in Ubuntu 14.04

SSH service remote access to Linux Server login is slow

How to Improve the SSH login authentication speed of Ubuntu

Enable the SSH service to allow Android phones to remotely access Ubuntu 14.04

How to add dual authentication for SSH in Linux

Configure the SFTP environment for non-SSH users in Linux

Configure and manage the SSH service on Linux

This article permanently updates the link address:

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.