SSH dual-Machine Trust building

Source: Internet
Author: User

in Linux system Management, it is the most common method to set up password-free login and make the machine batch management. For example, for dozens of or even hundreds of online machines, usually we will set up a "publishing machine" as a central control machine to the other online machine password-free login, and then the software, configuration file distribution, update, deployment. Of course, for the above problem, the solution is not optimal and unique, such as you can use expect analog automatic input to complete the automatic login verification process, or use some open source software now to automate the configuration and deployment tools, such as Puppet, but this is not in the scope of this article, What we are going to talk about today is the most primitive, most effective and direct way: password-free login.

Environment: Host a Godben 192.168.1.26

Host B godben2 192.168.1.30

To operate on host a:

        [[email protected]  ~]# ssh-keygen -t rsa               Generating public/private rsa key pair.         Enter passphrase  (empty for no passphrase):  (ignore: Direct carriage return)          Enter same passphrase again:  (Ignore: Direct carriage return)          Your identification has been saved in  /home/miao/.ssh/id_rsa.        your public key has  been saved in /home/miao/.ssh/id_rsa.pub. 
[Email protected] ~]# ssh-copy-id-i ssh/id_rsa.pub [email protected] Password:now try logging into the machine, with "SSH" [e-mail protected] ' ", and check in:. Ssh/authorized_keys to make sure we haven ' t added extra keys You weren ' t expecting.

To operate on Host B:

        [[email protected]  ~]# ssh-keygen -t rsa               Generating public/private rsa key pair.         Enter passphrase  (empty for no passphrase):  (ignore: Direct carriage return)          Enter same passphrase again:  (Ignore: Direct carriage return)          Your identification has been saved in  /home/miao/.ssh/id_rsa.        your public key has  been saved in /home/miao/.ssh/id_rsa.pub. 
[Email protected] ~]# ssh-copy-id-i ssh/id_rsa.pub [email protected] Password:now try logging into the machine, with "SSH" [e-mail protected] ' ", and check in:. Ssh/authorized_keys to make sure we haven ' t added extra keys You weren ' t expecting.

Test:

Operation on Host A: Ssh-l root 192.168.1.30

Operate on Host B: Ssh-l root 192.168.1.26

This article is from the "Godben" blog, make sure to keep this source http://godben.blog.51cto.com/8919725/1696308

SSH dual-Machine Trust building

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.