Establishing an SSH trust relationship between Linux hosts

Source: Internet
Author: User
Tags free ssh

Demand:

HostA to password-free SSH login to HostB, that is, to establish an SSH trust relationship


Implement:

1,HostA: In ~/.ssh, create SSH key pair

Execute command ssh-keygen-t RSA (requires input location Direct carriage return), default generated key pair file Id_rsa and Id_rsa.pub

2,HostB: In ~/.ssh, modify the trust file Authorized_keys

append HostA's public key file id_rsa.pub to hostB 's ~/.ssh/authorized_key S file


Verify:

HostA to password-free SSH login HostB


Summary:

I'm going to give you my public key by password-free login.


Possible surprises and workarounds:

A trust relationship is established, but it is still not possible to log in through a trust relationship and check:

1, the file permissions are correct (practice proves that this is useful)

SSH doesn ' t like it if your home or ~/.SSH directories has group write permissions. Your home directory should be writable, ~/.SSH should is, and Authorized_keys should be 600

             you can also get around this by adding strictmodes off to your ssh_config file, but I ' d advise against it-fixing Permissions is the "the" to Go

2. Ensure that the sshd service is turned on

3, with the SSH configuration file about /etc/ssh/sshd_config (without practice)

It is said that you can modify the SSH service authentication method, from password Authentication to public key authentication, please Baidu "/etc/ssh/sshd_config Trust relationship "



This article is from the "Harbin Degree" blog, please make sure to keep this source http://hadoooo.blog.51cto.com/12526479/1901045

Establishing an SSH trust relationship between Linux hosts

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.