Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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)