Virtual machine to build Hadoop's full distributed cluster-in detail (1), set up three virtual machine master, Slave1 and Slave2 hostname and IP address, so that the host can ping each other. This blog will continue to prepare virtual machines for a fully distributed Hadoop cluster, with the goal of enabling Master, Slave1, and Slave2 to log on to each other via SSH without a password.
SSH is a security protocol based on the application layer and transport layer, which can be used to remotely telnet to Linux hosts. Use SSH telnet host and related settings to refer to http://www.live-in.org/archives/832.html here you need to set up a Linux host password-free login, reference http://www.cnblogs.com/ Jdksummer/articles/2521550.html
First, determine that the same common user is established on three virtual machines in master, Slave1 and Slave2. The username I set up on three hosts is Sunnie password 19830304
Start master and log in as a user Sunnie, and then execute the following command:
CD ~/.ssh------------------------------switch to the/HOME/SUNNIE/.SSH directory
ssh-keygen-t RSA--------------------and then press ENTER continuously, the generated key is saved in the. ssh/id_rsa file according to the default options
The CP id_rsa.pub Authorized_keys----------------------------Copy the generated public key to the Authorized_keys file, and complete this step to use SSH on host master Master logged on to this machine, no password required
Start Slave1 and log in as a user Sunnie, and then execute the above three commands, you can use SSH Slave1 on the host Slave1 to log on this machine, do not need a password. The same method is implemented on the host Slave2 with ssh slave login without password
Below, how do I set up to log on to another host without a password as user Sunnie on host master Slave1?
First open the virtual machine Slave1, log in as the user Sunnie, set the VirtualBox shared Pasteboard as bidirectional mode. Next, open another virtual machine master and log in as a user Sunnie. Execute the following command on master
Vim ~/.ssh/authorized_keys
You can see the following: Master's SSH public key
Copy the master public key above, then execute Vim ~/.ssh/authorized_keys on Slave1 to open Authorized_keys file, append Master's public key to Authorized_keys's last This will enable you to perform SSH Slave1 password-free login on host master Slave1 the user Sunnie
Repeat the above method to reach the public key of all units in either Authorized_keys, i.e.
This can be in master, Slave1, Slave2 on any host as a user Sunnie in the identity of the SSH command without a password to log on to other hosts.