SSH key not working
I am trying to setup an SFTP connection using a private key. The key looks something like this (SSH2-RSA 2048-bit):
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDC7bqIpTeE6LZtQizTGS+0ZfSZh3oFETeEhwffWsbuJIOjWwUjmyEr3XHuoSGn78UC3NKqKTX51BOrV7IyAv5k2IzeRSPs9yY6oT8/5XhGWAjjiRrxXyyApPo7RcDdqwPQdW6M4X6QHrWfHTPHWD0ImG48qut/YrJWyLrxVji4blJp+g45nBKq4fRgV+enyRdIdGzHAUVo9yRGcdjXeN8g/QgyA0a9vt5I8kbf5VJkuEWb4desTZv89HXneo6WoHWYECGpDDJBFIc0m1h5ZRGoNrNuRQUQGymw29AdrTzpTu88OLZJpGGF/tr/sFPeyS4I20AyK36HHDJCODTfbp+3AgMBAAECggEBAKB0A0mbhfnXfOKuyCrz3nrGOfNuuxgUtfhXFjnahUldsSX0NGS8uy9aVwAwjn2oNilHD/mVdqKw2Yf+5eWY5UKppjsH+qyCPGuic2frQXfV22tAXnc0+nLiWkAUCM/uh3M+VsOMkhuby7Cv3wFGNucuYf96SeNPoLEjBg7GBGZ6qYHeBbhF1nOD4BwAuce/ybxqCOFwWb7TDvqMdndb5ncumcbwuZWObGvtiaXLFeWxeK7hxn42mQSRRR6O67+6K/p7czoI1zpfn55hpZovbpL06uhoaV3vlW8iSxLO5P5yZD50lpSec4Sa4q1nNbe8igms0dTw6F3Q0eGqYC9BPHECgYEA4Tk9gtlLFjjH7eBIFX0IZYc4/Q6/2p/y0oPoqQSgMTTTas6UwlvUvYfmyy8Ey4LrFO3zcIpAlWPxTNbblsNbH8PA8sqwcw9dAXeHWIS5gD+b9SuaNpLfGb0cmNwLKIMrWZ3e3EOxJStg/0iyEVCQche3aGJTwqwXXxKYEiXghvMCgYEA3ZC2IWh7DmCR/jmFW7LMYVPNZsNEylDWnwv4XmWL76u7l0TXBQzdrQdrrRqmhP/G6jKhwblyGUoVhHa78Urbgye1jdjhvAJLww9K25PgV/yDoiHjfN180A41hRO+kpDLWmQQHvDigKVgBynCMh9HybPtvMEXGUzbgLAt9b+1PS0CgYAcufdNhDeeivl9Lrki/IKgqIGtTT9NPE91aFu5ixx/ijRZECZLL/lPf1EBo2qiJn2jesItHYUlSM0TNuhlL1+lCovGq/Gbi18ae8toj+01HWff+oK96TfJiaRnHtHRhgF2ebteLsgebIz/op8LtFHoK3w6NShn0RleB/obfndH3wKBgB5GVsyr1Ry6z1gYjgNgpBKse8WN6wlmEF19KjvjzkI6ihB6ZJMZFfU9rVXi7VwBAzIfJwEskM2p1NTb0ISBAQuj0mgGeZnSCn4lycnFJAOByo7N6KK4NQTM3D1J3GF0jYTVZWqE6b5AWqW/6/wjUBDcmCCRldFsMhYcfLs2rdIlAoGBAJfP7ejhlgRPq5di22h+JhAhhUlQhnXxjwqT+UoEASIDklQrwAE2j1w9V3FJ8xF373IJdRybqY03IfMVtxfKf9Ch4FQKVgEZPwv7KrzIp4IKePnroTd5jVrX89TnoalWoQ8a/Llz+Zsl1PICndci62FGpgSMlNqBYhgAxEkYmO0A
-----END PRIVATE KEY-----
No matter what I try, I always receive an “invalid key” error. I’ve tried pasting it as well as using a .key file.
Any help would be greatly appreciated.
-
Anonymous commented
Convert privat Key (id_rsa) to legacy PEM Version.
" ssh-keygen -p -f id_rsa -m PEM "
-
m-p{3} commented
After some trials and error, copying the private key from ConnectBot doesn't work in itself.
You have to copy the private key from ConnectBot into a file (ie old_key), and process it with the following command (without quotes)
"openssl rsa -in old_key -out new_key"
copy the content of the new_key file into Solid Explorer and that one will work.
That new private key will start with
-----BEGIN RSA PRIVATE KEY-----
and ends with
-----END RSA PRIVATE KEY----- -
m-p{3} commented
Loading a private key (copied from Connector PubKeys manager) into Solid Explorer doesn't work, says the SSH private key is invalid.
Starts with
-----BEGIN PRIVATE KEY-----
and ends with
-----END PRIVATE KEY-----Trying to import the private key into PuttyGen and convert it yields the following error message: Couldn't load private key (unrecognised key type).
-
Gene commented
Florian:
You need to export the key to the OpenSSH format.That worked for me. I had a key created in puttygen so converted it to OpenSSH format using these steps:
http://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use -
Gene commented
Hi. Same issue here. Tried my SSH-PrivateKey.ppk file, a text file as shown in Florian's post above, and that text just pasted in (both with and without the PRIVATE KEY borders).
Any suggestions?
Gene