"Gandalf" Ubuntu cluster configuration-Free Login

Source: Internet
Author: User

IntroductionIt was written a few years ago, but the question has been repeatedly asked. So I decided to move it to the screen again. BodyThree nodes: Masternode slavenode1 Slavenode2 First step: All nodes generate key pair separatelyAll nodes to do: On the command line, run in the current User root folderssh-keygen-t RSAAfter the key is successfully generated, it is stored under the current User root folder under the. SSH hidden folder, 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 do: Copy the id_rsa.pub to the file Anthorized_keys file. Use the command in the. SSH directoryCP id_rsa.pub Authorized_keys Step Three: Merge the Authorized_keys files of all nodes and distribute them to the root folder of all nodes under the. SSH hidden folderSlavenode1 sends Authorized_keys to Masternode's Temp1 temporary file:SCP ~/.ssh/authorized_keys MASTERNODE:~/.SSH/TEMP1
Slavenode2 sends Authorized_keys to Masternode's Temp2 temporary file:SCP ~/.ssh/authorized_keys MASTERNODE:~/.SSH/TEMP2
Masternode Temp1 and Temp2 are appended to the Authorized_keys file, which masternode the Authorized_keys file includes 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 identify Authorized_keysAfter cd/etc/ssh/, sudo gedit sshd_config found the following lines in the file
rsaauthentication Yespubkeyauthentication Yes#AuthorizedKeysFile%h/.ssh/authorized_keysIf you remove the #, the system will be able to identify the public key by Authorized_keys. Fifth Step: Check whether SSHD performs/installs. Assuming no installation will fail to connect successfully to each otherPerformps-e | grep ssh。 See if there is an sshd process assumption that the server did not start. Start the server process by/etc/init.d/ssh-start the assumption that SSH does not exist then it is not installed server through the sudo apt-get install openssh-server command installation can be Sixth step: Solve Agent admitted failure to sign using the keyAssuming this error occurs, you need to run Ssh-add ~/.ssh/id_rsa on all nodes to add SSH to the private key. At this point, you are done. You should be able to use SSH masternode/slavenode1/slavenode2 to avoid password with each other on a random machine!!!

Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.

"Gandalf" Ubuntu cluster configuration-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.