I have been studying Hadoop recently. I have encountered a headache when I want to build the environment. I used the ssh service to connect to loaclhost In the Ubuntu environment. It took a long time to complete the setup, now I have sorted it out for reference. There are many methods on the Internet to implement ssh password-less login from the master to the slave. I will not introduce it here. The following steps are provided: Step 1. Create a key ~ /. Ssh $ ssh-keygen-trsaGener
I have been studying Hadoop recently. I have encountered a headache when I want to build the environment. I used the ssh service to connect to loaclhost In the Ubuntu environment. It took a long time to complete the setup, now I have sorted it out for reference. There are many methods on the Internet to implement ssh password-less login from the master to the slave. I will not introduce it here. The steps are as follows:
Procedure
1. Create a key
~ /. Ssh $ ssh-keygen-t rsa Generating public/private rsa key pair. enter passphrase (empty for no passphrase): (ignore) Enter same passphrase again: (ignore) Your identification has been saved in /. ssh/id_rsa. your public key has been saved in /. ssh/id_rsa.pub.
2. Add a public key to the Trust List
~ /. Ssh $ cat 192.168.1.101> authorized_keys
~ /. Ssh $
3. Start ssh-agent (previous steps)
If ssh localhost returns this prompt
Agent admitted failure to sign using the key
Ps-aux | grep agent: Check whether the ssh-agent is running. If no
~ /. Ssh $ ssh-agent
4. Add id_rsa to ssh-agent
~ /. Ssh $ ssh-add id_rsa if the prompt "cocould not open a connection to your authentication agent" is executed: ssh-agent bash 5. modify directory permissions
Sudo chmod 600 ~ /. Ssh/id_rsa sudo chmod 600 ~ /. Ssh/id_rsa.pubsudo chmod 644 ~ /. Ssh/known_hosts sudo chmod 755 ~ /. Ssh 6. login test ~ /. Ssh $ ssh localhost