"Gandalf" Ubuntu Cluster configuration authentication-Free Login

Source: Internet
Author: User

IntroductionIt was written a few years ago, but the question has been repeatedly asked, so I decided to put it back on the screen. BodyThree nodes: Masternode slavenode1 Slavenode2 First step: All nodes generate key pairs separatelyAll nodes to do: On the command line, in the current user root directory executionssh-keygen-t RSAAfter the key is successfully generated, it is stored in the current user's root directory. SSH hidden directory, directly with CD. SSH can enter, then use the LS command to see Id_rsa id_rsa.pub Step Two: Copy generation Authorized_keysAll nodes have to be done: Copy the id_rsa.pub to the file Anthorized_keys file and use the command under the. SSH folderCP id_rsa.pub Authorized_keys Step Three: Merge the Authorized_keys files of all the nodes and distribute them to the. SSH hidden folder in all node root directoriesSlavenode1 send Authorized_keys to masternode temp1 temp file:SCP ~/.ssh/authorized_keys MASTERNODE:~/.SSH/TEMP1
Slavenode2 send Authorized_keys to masternode temp2 temp file:SCP ~/.ssh/authorized_keys MASTERNODE:~/.SSH/TEMP2
Masternode Temp1 and Temp2 are appended to the Authorized_keys file, so masternode authorized_keys files contain the public key of all nodes:cat ~/.ssh/temp1 >> ~/.ssh/authorized_keyscat ~/.ssh/temp2 >> ~/.ssh/authorized_keysRM ~/.ssh/temp1RM ~/.ssh/temp2
Distribute the merged Authorized_keys files to each node in the Masternode:SCP ~/.ssh/authorized_keys slavenode1:~/.ssh/SCP ~/.ssh/authorized_keys slavenode2:~/.ssh/ Fourth Step: All system configuration/etc/ssh/sshd_config file, make the system use public key authentication, and can recognize Authorized_keysAfter cd/etc/ssh/, sudo gedit sshd_config found the following lines in the file
rsaauthentication Yespubkeyauthentication Yes#AuthorizedKeysFile%h/.ssh/authorized_keysRemove the # and the system will be able to identify the public key by Authorized_keys. Fifth Step: Check if SSHD is running/installed and will not be able to connect successfully to each other if not installedRunps-e | grep sshTo see if there is an sshd process if not, the server is not started, the server process is started through/etc/init.d/ssh-start if the prompt ssh does not exist then it is not installed server via sudo apt-get install Openssh-server command installation can be Sixth step: Solve Agent admitted failure to sign using the keyIf this error occurs, you will need to execute Ssh-add ~/.ssh/id_rsa on all nodes to join the private key to SSH. At this point, you are done!! You should be able to use SSH masternode/slavenode1/slavenode2 password to connect to each other on any machine!!!

"Gandalf" Ubuntu Cluster configuration authentication-Free Login

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.