remote-sync icon indicating copy to clipboard operation
remote-sync copied to clipboard

Uncaught Error: Cannot parse privateKey: Unsupported key format

Open marcomarotta opened this issue 7 years ago • 7 comments

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.17.0 ia32 Electron: 1.3.15 OS: Unknown Windows version Thrown From: remote-sync package 4.1.5

Stack Trace

Uncaught Error: Cannot parse privateKey: Unsupported key format

At C:\Users\marco\.atom\packages\remote-sync\node_modules\ssh2\lib\client.js:225

Error: Cannot parse privateKey: Unsupported key format
    at Client.connect (/packages/remote-sync/node_modules/ssh2/lib/client.js:225:13)
    at ScpTransport.module.exports.ScpTransport._getConnection (/packages/remote-sync/lib/transports/ScpTransport.coffee:179:16)
    at ScpTransport.module.exports.ScpTransport.fetchFileTree (/packages/remote-sync/lib/transports/ScpTransport.coffee:119:6)
    at Object.run (/packages/remote-sync/lib/commands/DownloadAllCommand.coffee:12:15)
    at RemoteSync.downloadFolder (/packages/remote-sync/lib/RemoteSync.coffee:86:17)
    at handleEvent (/packages/remote-sync/index.coffee:46:14)
    at /packages/remote-sync/index.coffee:104:44)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.17.0/resources/app/src/command-registry.js:265:1)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.17.0/resources/app/src/command-registry.js:3:1)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (~/AppData/Local/atom/app-1.17.0/resources/app/src/command-registry.js:166:1)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (~/AppData/Local/atom/app-1.17.0/resources/app/src/atom-environment.js:1292:1)
    at EventEmitter.outerCallback (~/AppData/Local/atom/app-1.17.0/resources/app/src/application-delegate.js:347:1)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -2:37.5.0 project-find:show-in-current-directory (li.file.entry.list-item.selected)
  3x -2:35.8.0 core:cancel (div.tool-panel.tree-view)
     -2:28.2.0 remote-sync:download-file (li.file.entry.list-item.status-modified.selected)
  2x -1:56.4.0 core:delete (input.hidden-input)
     -1:06.2.0 intentions:highlight (input.hidden-input)
     -1:06.0 core:paste (input.hidden-input)
     -1:04.4.0 intentions:highlight (input.hidden-input)
     -1:04.3.0 core:save (input.hidden-input)
     -1:01.9.0 core:delete (input.hidden-input)
     -1:00.9.0 intentions:highlight (input.hidden-input)
     -1:00.8.0 core:save (input.hidden-input)
     -0:50.5.0 remote-sync:download-folder (div.header.list-item)
     -0:12.8.0 intentions:highlight (input.hidden-input)
     -0:12.7.0 core:save (input.hidden-input)
     -0:07.9.0 remote-sync:download-folder (div.header.list-item)
     -0:05.5.0 core:cancel (a.btn-issue.btn.btn-error.opening)

Non-Core Packages

atom-autocomplete-php 0.22.2 
atom-beautify 0.29.24 
atom-bootstrap3 1.2.12 
atom-material-syntax 1.0.6 
atom-material-ui 2.0.3 
atom-text-transformer 0.7.0 
busy-signal 1.4.1 
fancy-bracket-matcher 1.0.1 
file-icons 2.1.6 
highlight-selected 0.13.1 
html-entities 0.4.0 
intentions 1.1.2 
linter 2.1.4 
linter-csslint 1.3.4 
linter-htmlhint 1.3.3 
linter-jshint 3.1.2 
linter-php 1.3.2 
linter-ui-default 1.5.4 
minimap 4.28.2 
minimap-autohider 1.4.0 
minimap-find-and-replace 4.5.2 
minimap-highlight-selected 4.6.1 
minimap-pigments 0.2.2 
minimap-selection 4.4.0 
open-recent 5.0.0 
php-integrator-base 2.1.12 
pigments 0.39.1 
remote-edit 1.9.0 
Remote-FTP 0.10.7 
remote-sync 4.1.5 
sequential-command 0.3.0 
Sublime-Style-Column-Selection 1.7.4 
text-manipulation 0.6.0 

marcomarotta avatar May 19 '17 13:05 marcomarotta

if you generated your keys with puttygen then save as openssh then try, worked for me 😄

ragolz avatar Mar 06 '18 17:03 ragolz

Hello, I have the same problem with a key generated using ssh-keygen on Kubuntu 18.04

husimo avatar Sep 18 '18 13:09 husimo

I have no idea what to do.

I'm generating the key via Mac, with ssh-keygen. I've followed the instructions on https://atom.io/packages/remote-sync exactly

ssh-keygen -t rsa , upload the public key to my GCP instance, reboot atom and GCP, nothing

ssh-keygen -t rsa -C USERNAME_ON_REMOTE upload the public key, reboot atom and GCP, nothing

ssh-keygen -t ed25519 upload the public key, reboot atom and GCP, nothing

ssh-keygen -t ed25519 -C USERNAME_ON_REMOTE, upload the public key, reboot atom and GCP, nothing

it can be noted that with ANY of the keys I've made with -C USERNAME_ON_REMOTE I can connect to the remote machine with scp or ssh with no issue

any solutions?

dfreelan avatar Mar 22 '19 16:03 dfreelan

I cat pelengate all of supporters to индуктивно абдуктивно охладить ниже нуля более чем на 15-20 минут или даже полтора - два часа. Can it help?

serhiobb avatar Sep 24 '19 18:09 serhiobb

The problem seems to be the format of the privatekey. This worked for me:

Regenerate a new couple of private/public keys using the "pem" format. $ ssh-keygen -t rsa -m pem

Then install the key to your server. $ ssh-copy-id -i /path/to/the/new/key [email protected]

Copy the /path/to/the/new/key to remote-sync configuration.

smariel avatar Apr 02 '20 12:04 smariel

ssh-keygen -t rsa -m pem

This did not work for me. I still get the same error.

vmkalbskopf avatar Aug 19 '21 08:08 vmkalbskopf

This is what worked for me recently on a Mac with the latest version of Atom

vi ~/.ssh/config

(you might not have this file, and that's OK, it will create a new one for you), and add this line

AddKeysToAgent yes

Now add your key (change the path as needed)

ssh-add ~/.ssh/id_rsa

And now adjust your config. Remove the reference to your ssh key in keyfile and specify that you want to use useAgent as shown below. Please adjust for your host, target and username.

{
  "uploadOnSave": true,
  "hostname": "<PROVIDE YOUR IP ADDRESS, e.g. 10.1.1.99>",
  "target": "<PROVIDE YOUR TARGET PATH ON THE SERVER>",
  "ignore": [
    ".remote-sync.json",
    ".git/**"
  ],
  "username": "<PROVIDE YOUR USERNAME, e.g. a4word>",
  "useAgent": true,
  "transport": "scp",
  "deleteLocal": false
}

Again the main thing is

DELETE `keyfile`
ADD `useAgent`

aforward avatar Oct 14 '21 23:10 aforward