1. Add new users
sudo useradd -m hadoop -s /bin/bash
add password
sudo passwd hadoop
Additional permissions
sudo adduser hadoop sudo
Switch to the hadoop user, when running the sudo command it appears: hadoop is no longer in the sudoers file, this will be reported.
Solution: switch to the root user, open the /etc/sudoers file, add
hadoop ALL=(ALL:ALL) ALL
There is an example of a user in the file, and the above command is written like
Switch to the hadoop directory (the following operations are performed in the hadoop directory, including idea, jdk (copy the environment variables in .bashrc under root to
in the bashrc file in the hadoop directory))
Second, configure password-free login ssh
Generate ssh public key
ssh-keygen -t rsa
Install openssh-server (openssh-clients usually come with the system)
sudo apt-get install openssh-server
Enter the .ssh directory in the directory of the public key (add authorization)
cat id_rsa.pub >> authorized_keys
give permission
chmod 600 ./authorized_keys
Run the command: ssh localhost
出现:sign_and_send_pubkey: signing failed: agent refused operation
and ask for a password
Solution:
eval "$(ssh-agent -s)" ssh-addThen run: ssh localhost You can enter without entering a password, and exit can exit ssh