The ultimate explanation of ssh password-less login and the ultimate explanation of ssh password-less Login

Source: Internet
Author: User

The ultimate explanation of ssh password-less login and the ultimate explanation of ssh password-less Login

Directory:/root/. ssh


The configuration involves four shells.


1. One operation per machine

Ssh-keygen-t rsa

Generate an ssh key. The generated file is as follows:


. Pub is the public key, and No. pub is the private key.


2. One operation per machine

Cp authorized_keys


Authorized_keys Error


3. copy and distribute each machine.

Scp hadoop262:/root/. ssh/


Scp for remote copy

Copy the Local Public Key to the/root/. ssh directory of hadoop262. The new file name is


4. Add the public key of another machine to the local machine and you will not be able to enter the password.

Cat> authorized_keys


In addition to the file, all xxxxx. pub machines are added;



Host ing of/etc/hosts, ing to the local machine, hostname of the Local Machine in/etc/sysconfig/network, as long as there is no conflict, generally there will be no problem, if you are afraid, you will be confused and in conflict.


My shell script:


/Etc/hosts --> Configuration

# Master hadoop localhost hadoop261

# Salve1 hadoop hadoop262

# Salve2 hadoop hadoop263 localhostlocalhost. localdomain hadoop261


/Etc/sysconfig/network--> Configuration


HOSTNAME =Hadoop261




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: 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.