prathviraj18@prathviraj18:~$ start-dfs.sh Starting namenodes on [localhost] localhost: prathviraj18@localhost: Permission denied (publickey,password). Starting datanodes localhost: prathviraj18@localhost: Permission denied (publickey,password). Starting secondary namenodes [prathviraj18] prathviraj18: prathviraj18@prathviraj18: Permission denied (publickey,password). 2020-01-29 14:48:47,655 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2 Answers
Follow as it is mentioned your issue will be solved don't escape any command if you already generated key value pair then also follow from step 1: It will generate new value pair and configure it so that your issue will be solved 1. Generate local key pairs
Firstly, you need to generate key pairs in your local Linux box:
$ ssh-keygen
You are going to see the output like this:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): just press Enter button
Enter same passphrase again: just Press Enter button
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
96:d3:8d:0e:d9:bf:af:fd:18:2e:67:3d:b3:19:a4:f8 [email protected]
Press Enter to accept default file location to save key pairs, and a strong passphrase for your key files. 2. Upload public key file to Linux server
File ~/.ssh/id_rsa.pub contains the public key of the local Linux box. We need to upload this file to the Linux server, so the server can use the public key to authenticate the user:
$ scp .ssh/id_rsa.pub user.sru.edu:~/
user.sru.edu's password:
id_rsa.pub 100% 422 0.4KB/s 00:00 3. Append id_rsa.pub to ~/.ssh/authorized_keys file
The last step is append the public key of our local Linux box to the end of .ssh/authorized_keys file in the Linux server, so our local Linux box can be automatically authenticated.
$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
Now we do not need the public key file in the Linux server any more, so we can safely delete it in the Linux server:
$ rm ~/id_rsa.pub
Generate SSH key & give location to store.
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
append generated key to authorized_keys inside /.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
modify permissions of authorized_keys.
chmod 0600 ~/.ssh/authorized_keys
verify by ssh into localhost.
ssh localhost
Optional: rm ~/id_rsa.pub