Created 03-13-2018 07:55 AM
host registration with ambari getting failed .
I am setting single node cluster , I am not able to do ssh to same node . I am following below steps on the same :
1. ssh-keygen
2. cat id_rsa.pub >> authorized_keys
3. chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
but when i do ssh host.FQDN it gives below error :
The authenticity of host can't be established.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
please help on this.
Thanks in Advance
Created 03-13-2018 08:03 AM
On the ambari server host you need to do this:
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@newhost.example.com
.
The above command will copy the SSH public key from Ambari server host "~/.ssh/id_rsa.pub" to the new host (for example newhost.example.com) then once you are able to run the command successfully then you should be able to do passwordless ssh from Ambari Serevr host to the New Node. Then try registering the agent from ambari UI again.
Created 03-13-2018 08:03 AM
On the ambari server host you need to do this:
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@newhost.example.com
.
The above command will copy the SSH public key from Ambari server host "~/.ssh/id_rsa.pub" to the new host (for example newhost.example.com) then once you are able to run the command successfully then you should be able to do passwordless ssh from Ambari Serevr host to the New Node. Then try registering the agent from ambari UI again.
Created 03-13-2018 08:27 AM
executed below command still getting same error :
[root@host .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub root@<host_fqdnt> Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Created 03-13-2018 08:35 AM
Please do the following check? Then we will check about Password less ssh.
1. Please check if SSH itself is possible from AmbariServer host to NewHost or not?
# ssh root@<host_fqdn>
2. If above is not working then you will need to see if the new host has the proper SSH settings and it allows the password based authentication? So on the new node please check if the "PasswordAuthentication" is set as "yes" and the "PermitRootLogin" is set to "yes"
# grep 'PasswordAuthentication' /etc/ssh/sshd_config PasswordAuthentication yes # grep 'Root' /etc/ssh/sshd_config PermitRootLogin yes
.
If these values are not set to "yes" then please set them and then restart the SSHD service on the new host.
# systemctl restart sshd (OR) # service sshd restart<br>
.
3. Now from ambari server host check if you are able to do SSH with password or not? If ssh works then try doing the passwordless ssh using:
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@newhost.example.com
Created 03-13-2018 08:42 AM
If this also does not work then please try this:
On the ambari server host regenerate the ssh keys exactly as following:
1. Move the old SSH keys directory (take backup as following)
# mv ~/.ssh ~/.ssh_OLD
2. Regenerate the SSH keys on ambari server host without entering any passphrase.
NOTE : Just press enter when it asks for passphrase (please do not enter any value there)
# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again:
.
3. Now from ambari server host check if you are able to do SSH with password or not? If ssh works then try doing the passwordless ssh using:
# ssh-copy-id -i ~/.ssh/id_rsa.pub root@newhost.example.com
.
Created 03-13-2018 09:07 AM
Thanks jay, It is working now .
PasswordAuthentication yes
it's value was set to no