SSH Jump no password login or execute command

Source: Internet
Author: User
Tags scp command

We are using Linux development process, often need to jump between different servers, through SSH, each need to enter the password, more cumbersome, today from the Internet to find the relevant methods, but the experimental process found that there are some problems, special will be some details of the following:

For example, I have the machine 192.168.1.100 and 192.168.1.200 two servers, I want to log in from 100 to 200 to use SSH not to enter the password, so I need to do the following steps

1, first in IP for the machine to execute the Ssh-keygen command, all the way to return, so that, in the current user directory under the. SSH folder generated two files Id_rsa and id_rsa.pub files

2. Transfer the ID_RSA.PUB to 200 machines using the SCP command, such as SCP id_rsa.pub root@192.168.1.200:/root/.ssh/100.put

If you have authorized_keys this file in the 200/root/.ssh/directory, add the 100.put file content to Authorized_keys directly using the Cat command

Commands are as follows: Cat 100.pub >> Authorized_keys

Note that you cannot make use of manual copies, or it will cause failure, only cat >> (which I have tried many times)

3, the right to modify the Authorized_keys 600, as follows: chmod Authorized_keys

Then delete 100.pub on it, done, hurriedly to 100 of the machine try SSH root@192.168.1.200, look directly into the bar, no longer enter the password.

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.