Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) during ambari hadoop installation

Tags:

ssh

hadoop

ambari

I am trying to deploy a hadoop cluster using ambari, but when i select the hostnames with FQDN and proceed to configure I get the permission denied error for ssh.

STEPS: 1. generated rsa key using ssh-keygen as root.

  1. changed permission for .ssh(700) and authorized_keys(640)
  2. cat the public key to authorized_keys.
  3. and copied the public key to all the hosts(authorized_keys) and changed the file permission as above.
  4. I could ssh passwordless from ambari server host to all the other hosts.

But from ambari is failing to do the hadoop installation with below error.

SSH command execution finished
host=XXX, exitcode=255
Command end time 2015-06-23 10:44:07

ERROR: Bootstrap of host XXX fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

STDOUT: 
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

Please dont mark this question as a duplicate. I could see other questions with same description but none of them mention about the Ambari ssh permission denied error.

like image 792
Abhi.G Avatar asked Jun 23 '15 17:06

Abhi.G


People also ask

Why do I get permission denied Publickey?

"Permission denied (publickey)" and "Authentication failed, permission denied" errors occur if: You're trying to connect using the wrong user name for your AMI. The file permissions within the operating system are incorrect on the instance. The incorrect SSH public key (.


2 Answers

I encountered the same problem with him.

ssh -i <your_keypair> root@<your_host> I tried this but it wasn't solved.

Here's my solution

host1 ip:192.168.1.21

host2 ip:192.168.1.22

host3 ip:192.168.1.23

on host1:

rm -rf /root/.ssh
ssh-keygen -t dsa
cat /root/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
scp /root/.ssh/id_dsa.pub host2:/root/
scp /root/.ssh/id_dsa.pub host3:/root/

on host2:

rm -rf /root/.ssh
ssh-keygen -t dsa
cat /root/id_dsa.pub >> /root/.ssh/authorized_keys

on host3:

rm -rf /root/.ssh
ssh-keygen -t dsa
cat /root/id_dsa.pub >> /root/.ssh/authorized_keys

host1:/root/.ssh/id_dsa This's the file which you need.

like image 84
K.Alan Avatar answered Sep 28 '22 04:09

K.Alan


You should be able to execute something like

ssh -i <your_keypair> root@<your_host>

from some other host. If this is not working, then you are using wrong keypair.

like image 35
melhior Avatar answered Sep 28 '22 03:09

melhior