Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari server can't authenticate with publickey

Ambari server can't authenticate with publickey

New Contributor

I've been trying to get this to work for two weeks and my last post asking for help got downvoted without any comments. I hope to understand more of the topic now and provide more information.

I have two ubuntu 18.04 VMs one has the Ambari server and the other is the agent. I've set up the keys on the machines and they are working perfectly. This is the error I'm getting when I try to register the agent:

root@agent01.cluster: Permission denied (publickey,password).
SSH command execution finished
host=agent01.cluster, exitcode=255
Command end time 2019-04-09 12:11:16

ERROR: Bootstrap of host agent01.cluster fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: root@agent01.cluster: Permission denied (publickey,password).

Ambari-Server: ambari.cluster (192.168.178.50)

Ambari-Agent01: agent01.cluster (192.168.178.51)

This was my workflow up to getting the error:

  1. SSH from my laptop to ambari.cluster
  2. become root of ambari.cluster
  3. root@ambari-server: ssh-agent bash
  4. root@ambari-server: ssh-add -L
  5. If there is no key set I'd add it
  6. root@ambari-server: ssh root@agent01.cluster Works perfectly
  7. Try to register the host on the ambari server user interface. This is where I get the error from above

SSH with verbose:

root@ambari:/home/ambari# ssh -v root@agent01.cluster
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to agent01.cluster [192.168.178.51] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to agent01.cluster:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:3O7/r4qqVJLPgJFBIYqzWt12DX8+CGUn7rI9cat4WgA
debug1: Host 'agent01.cluster' is known and matches the ECDSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:xKpUfZm12W6sHSqwVemYib2QAfezRL3bXayhoSGMIdY /root/.ssh/id_rsa
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug1: Authentication succeeded (publickey).
Authenticated to agent01.cluster ([192.168.178.51]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-47-generic x86_64)

The logs from ambari-server:

INFO:root:BootStrapping hosts ['agent01.cluster'] using /usr/lib/ambari-server/lib/ambari_server cluster primary OS: ubuntu18 with user 'root'with ssh Port '22' sshKey File /var/run/ambari-server/bootstrap/3/sshKey password File null using tmp dir /var/run/ambari-server/bootstrap/3 ambari: ubuntu-server-6.home; server_port: 8080; ambari version: 2.7.3.0; user_run_as: root
INFO:root:Executing parallel bootstrap
ERROR:root:ERROR: Bootstrap of host agent01.cluster fails because previous action finished with non-zero exit code (255)
ERROR MESSAGE: root@agent01.cluster: Permission denied (publickey,password).

STDOUT: 
root@agent01.cluster: Permission denied (publickey,password).

INFO:root:Finished parallel bootstrap

I then tried to add my SSH-Key to /var/run/ambari-server/bootstrap/3/sshKey but wasn't successful.

I'm lost now, where should I look next?

Thanks for any help!

Don't have an account?
Coming from Hortonworks? Activate your account here