You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/25 21:27:24 UTC

[GitHub] [airflow] Siddharthk opened a new issue #9519: How to use private_key for SSH Operator

Siddharthk opened a new issue #9519:
URL: https://github.com/apache/airflow/issues/9519


   I was not able to find documentation on how to use private_key for SSH operator. Below is my sample key which I want to use as a string.
   ```
   -----BEGIN RSA PRIVATE KEY-----
   MIIJKAIBAAKCAgEAm9G0SDaHyEIsMez1oa0+N4XX+ThVMjzdvdggadggSc3bmRsP
   lU1Ab+reLVtDPrDJAyjvxvWcT285f160sffxhfjfjryetZE/Xwo2ItzWDwgps/IF
   -----END RSA PRIVATE KEY-----
   ```
   
   I am getting below error currently:
   ```
    File "/usr/local/lib/python3.6/dist-packages/airflow/contrib/hooks/ssh_hook.py", line 108, in __init__
       self.pkey = paramiko.RSAKey.from_private_key(StringIO(private_key))
     File "/usr/local/lib/python3.6/dist-packages/paramiko/pkey.py", line 256, in from_private_key
       key = cls(file_obj=file_obj, password=password)
     File "/usr/local/lib/python3.6/dist-packages/paramiko/rsakey.py", line 52, in __init__
       self._from_private_key(file_obj, password)
     File "/usr/local/lib/python3.6/dist-packages/paramiko/rsakey.py", line 179, in _from_private_key
       data = self._read_private_key("RSA", file_obj, password)
     File "/usr/local/lib/python3.6/dist-packages/paramiko/pkey.py", line 324, in _read_private_key
       raise SSHException("not a valid {} private key file".format(tag))
   paramiko.ssh_exception.SSHException: not a valid RSA private key file
   ```
   Can someone help me out?
    
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #9519: How to use private_key for SSH Operator

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #9519:
URL: https://github.com/apache/airflow/issues/9519#issuecomment-649826501


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #9519: How to use private_key for SSH Operator

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #9519:
URL: https://github.com/apache/airflow/issues/9519#issuecomment-650713604


   The use of "key_file" is incorrect.
   Here is docs: https://airflow.readthedocs.io/en/latest/howto/connection/ssh.html


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nullhack commented on issue #9519: How to use private_key for SSH Operator

Posted by GitBox <gi...@apache.org>.
nullhack commented on issue #9519:
URL: https://github.com/apache/airflow/issues/9519#issuecomment-650142616


   Hi @Siddharthk you can create an dict on extra fields of your ssh connection with a key `key_file` and value equal your private key file.
   The code is at: https://github.com/apache/airflow/blob/master/airflow/providers/ssh/hooks/ssh.py#L103


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nullhack removed a comment on issue #9519: How to use private_key for SSH Operator

Posted by GitBox <gi...@apache.org>.
nullhack removed a comment on issue #9519:
URL: https://github.com/apache/airflow/issues/9519#issuecomment-650142616


   Hi @Siddharthk you can create an dict on extra fields of your ssh connection with a key `key_file` and value equal your private key file.
   The code is at: https://github.com/apache/airflow/blob/master/airflow/providers/ssh/hooks/ssh.py#L103


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed issue #9519: How to use private_key for SSH Operator

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #9519:
URL: https://github.com/apache/airflow/issues/9519


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org