Closed jwflory closed 1 month ago
Not sure why it fails, is your key using DSS instead of RSA?
@olav-st The key is definitely RSA. I use the same key for authentication with my servers. I generated it with the ssh-keygen
command on OS X.
Try entering this in the debug console (go to Preferences
and hit Ctrl+D
or Command+D
) and see what output you get:
import paramiko
paramiko.RSAKey.from_private_key_file("~/.ssh/id_rsa")
@olav-st: As requested, here is the result.
py> paramiko.RSAKey.from_private_key_file("~/.ssh/id_rsa")
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/pkey.py", line 198, in from_private_key_file
key = cls(filename=filename, password=password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/rsakey.py", line 51, in __init__
self._from_private_key_file(filename, password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/rsakey.py", line 163, in _from_private_key_file
data = self._read_private_key_file('RSA', filename, password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/pkey.py", line 279, in _read_private_key_file
f = open(filename, 'r')
IOError: [Errno 2] No such file or directory: '~/.ssh/id_rsa'
The file definitely exists, though…
Try using the absolute path (without the ~)
@olav-st: Output below. Also, I do not use a passphrase with my private key.
py> paramiko.RSAKey.from_private_key_file("/Users/justinflory/.ssh/id_rsa")
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/pkey.py", line 198, in from_private_key_file
key = cls(filename=filename, password=password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/rsakey.py", line 51, in __init__
self._from_private_key_file(filename, password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/rsakey.py", line 163, in _from_private_key_file
data = self._read_private_key_file('RSA', filename, password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/pkey.py", line 280, in _read_private_key_file
data = self._read_private_key(tag, f, password)
File "/Users/justinflory/Library/Application Support/screencloud/ScreenCloud/plugins/sftp/modules/paramiko/pkey.py", line 323, in _read_private_key
raise PasswordRequiredException('Private key file is encrypted')
paramiko.PasswordRequiredException: Private key file is encrypted
Strange... Maybe your private key is encrypted, but ssh gets the password from the OS X keychain?
@olav-st: If I open up the private key in a program like TextEdit, I can view it fine, if that helps any.
Does it say "ENCRYPTED" at the start of the file? http://serverfault.com/questions/52732/find-out-if-a-ssh-private-key-requires-a-password
@olav-st: This is one of the lines in the file, but outside of this, there are no other mentions of encryption.
Proc-Type: 4,ENCRYPTED
I just had this problem, for me I had to convert my private key to a PEM file and use that.
@thesbros - how did you end up doing that?
@jflory7
openssl rsa -in ~/.ssh/id_rsa -outform PEM -out ./id_rsa.pem
@thesbros Doesn't seem to be working for me. It prompts me for a passphrase that I don't have, and then if I type something in, it gives an error.
$ openssl rsa -in id_rsa -outform PEM -out ./id_rsa.pem
Enter pass phrase for id_rsa:
12201:error:28069065:lib(40):UI_set_result:result too small:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/ui/ui_lib.c:850:You must type in 4 to 1023 characters
Enter pass phrase for id_rsa:
unable to load Private Key
12201:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/evp/evp_enc.c:330:
12201:error:0906A065:PEM routines:PEM_do_header:bad decrypt:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/pem/pem_lib.c:428:
@jflory7 Try just not typing anything in and hitting enter / return.
@thesbros That's what I did the first time, and I had the first error listed.
12201:error:28069065:lib(40):UI_set_result:result too small:/SourceCache/OpenSSL098/OpenSSL098-50/src/crypto/ui/ui_lib.c:850:You must type in 4 to 1023 characters
I am also getting "unable to parse key file", on Ubuntu 14.04 and SC 1.1.6. I will try some of the above recommendations.
Okay, the issue was that my keyfile has a passphrase and I just haven't used it in so long I forgot about it. Converting to the PEM file requires a passphrase and then strips out the passphrase. So just set the passphrase in the SC settings and it connects then.
The error message could be improved a bit. If possible to determine if it is a bad passphrase then reflect that in the error message instead of the parse error but if not then just say "unable to parse key file OR bad passphrase".
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed after 30 days.
bot: still an issue I believe.
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed after 30 days.
This issue was closed because of inactivity. If this issue is still relevant, please re-open a new issue.
I recently installed ScreenCloud to my OS X iMac running 10.9.4.
I use RSA key authentication on my private server, which I planned to use with ScreenCloud. However, whenever I add my RSA private key from
~/.ssh/id_rsa
and attempt to upload a screenshot, ScreenCloud is unable to parse my RSA private key. See screenshot below: Alternatively, I have tried converting my RSA key to a .txt and .key file, but that had no effect. I'm not sure how I can get ScreenCloud to recognize my RSA private key.Any help would be appreciated. Thanks.