Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Authentication with ssh private key ( No provider available)

avatar
Explorer

Hello

 

I'm having issues with the Python CM API, same as this post.

 

I am unable to install the host using a private key isntead of password:

 

cmd = cm.host_install(host_username, host_list, private_key="/home/ec2-user/.ssh/id_rsa", cm_repo_url=cm_repo_url)

 

2016-01-05 06:55:21,364 WARN NodeConfiguratorThread-21-0:com.cloudera.server.cmf.node.NodeConfigurator: Could not authenticate to ip-170-195-1-237.eu-west-1.compute.internal
net.schmizz.sshj.common.SSHException: No provider available for Unknown key file

 

I have validated keys and can connect without password:

[ec2-user@ip-170-195-1-237 cloudera-scm-server]$ ssh ec2-user@ip-170-195-1-237.eu-west-1.compute.internal
Last login: Tue Jan  5 06:59:46 2016 from ip-170-195-1-237.eu-west-1.compute.internal
[ec2-user@ip-170-195-1-237 ~]$

 

Pls advise

 

thanks

 

1 ACCEPTED SOLUTION

avatar
Master Collaborator

you will need to pass the content of the "/home/ec2-user/.ssh/id_rsa".

 

Example:

id_rsa = ''

 

with open("/home/ec2-user/.ssh/id_rsa", 'r') as f:
  id_rsa = f.read()

 

cmd = cm.host_install(host_username, host_list, private_key=id_rsa, cm_repo_url=cm_repo_url)

 

 

 

View solution in original post

1 REPLY 1

avatar
Master Collaborator

you will need to pass the content of the "/home/ec2-user/.ssh/id_rsa".

 

Example:

id_rsa = ''

 

with open("/home/ec2-user/.ssh/id_rsa", 'r') as f:
  id_rsa = f.read()

 

cmd = cm.host_install(host_username, host_list, private_key=id_rsa, cm_repo_url=cm_repo_url)