-
Notifications
You must be signed in to change notification settings - Fork 95
Cannot parse privateKey: Unsupported key format #131
Comments
This is not a bug. You should use: client.scp({ |
Thank you @geovanneb, your solution worked for mу. However, instead of |
I tried using exact path @geovanneb, here is my code
|
@SergeyMell, the problem you encountered is not specific to this library, but rather node.js. You can test with this simple code: const fs = require('fs')
console.log(fs.readFileSync('~/test-file.txt').toString()) // this would throw error You can use the solution in this SO entry to work around that problem. |
scpclient.scp({
host,
port,
username,
privateKey: require('fs').readFileSync(SSH_KEY_PATH),
passphrase,
path,
}, dest); same error, |
I am getting this error when I try to connect with server using a ssh key.
I am using this key format
This is my code
Looking for more info about this error, I guess you must to add a new property for ask which ssh key formar are using. Take a look at this documentation:
https://github.com/mscdex/ssh2-streams#utility-methods
The text was updated successfully, but these errors were encountered: