Linux SSH password-free login configuration because of learning hadoop, SSH password-less login is required between clusters, so before installing hadoop, you must configure password-less SSH Login between machines. How do I Configure SSH login without a password? The following example shows how to log on to machine B without A password on machine A: 1. Switch to the user you want to log on to, for example, we use the user named hadoop of machine A to log on to the hadoop user of machine B. Www.2cto.com su hadoop switches to hadoop users. 2. Change the Host Name of the two machines. Here, A: master B: slave1: Modify the host name in the file "etc/sysconfig/network. NETWORKING = yes HOSTNAME = Remember to restart the host name !!! And modify the hosts ing: vi/etc/hosts www.2cto.com Java code 192.168.1.60 master 192.168.1.61 slave1 192.168.1.62 slave2 write the corresponding IP address and host name 2, A machine: Generate rsa public key: ssh-keygen-t rsa-f ~ /. Ssh/id_rsa //-t encryption type-f key file storage path, if: Java code [hadoop @ master ~] $ Ssh-keygen-t rsa-f ~ /. Ssh/id_rsa Generating public/private rsa key pair. created directory '/home/hadoop /. ssh '. enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in/home/hadoop /. ssh/id_rsa. your public key has been saved in/home/hadoop /. ssh/id_rsa.pub. the key fingerprint is: e9: AB: f0: 48: af: 2d: d4: 98: 59: 68: bc: 3d: 52: 3e: 94: bc hadoop @ master The key's randomart im Age is: + -- [RSA 2048] ---- + |. o. | + *. |. %. S | B E. |. o. o. | .. *. | oo = .. | + --------------- + [hadoop @ master ~] $ Cd. ssh also performs the second operation on machine B. 3. Set machine A/home/hadoop /. the id_rsa.pub under ssh/is transmitted to the/home/hadoop /. ssh/and rename it as master Java code [hadoop @ master. ssh] $ scp id_rsa.pub hadoop @ slave1:/home/hadoop /. ssh/master hadoop @ slave1's password: id_rsa.pub 100% 395 0.4KB/s 4. Switch to the B server, log on to the hadoop user, and append the uploaded master to the file named authorized_keys, if cat master> authorized_keys does not exist, permissions are automatically created. 5. modify the permissions of authorized_keys and id_rsa.pub to 644 Java code [hadoop @ slave1. ssh] $ Chmod 644 id_rsa.pub [hadoop @ slave1. ssh] $ chmod 644 authorized_keys at this time, the SSH password-free login configuration is successfully tested. At this time, run the Java code [hadoop @ master. ssh] $ ssh slave1 Last login: Mon Mar 4 22:23:06 2013 from master [hadoop @ slave1 ~] $ No password is prompted. The configuration is successful at www.2cto.com.