3

I tried using the module ssh2 by mscdex which, but it doesn't support the key ed25519.

var Connection = require('ssh2');
var c = new Connection();
c.connect({
    host: host,
    port: port, 
    username: user,
    privateKey: require('fs').readFileSync(keyPath)
});

The error is:

node_modules/ssh2/lib/client.js:225                                               
      throw new Error('Cannot parse privateKey: ' + privKeyInfo.message);                      
      ^                                                                                        

Error: Cannot parse privateKey: Unsupported key format                                         
    at Client.connect

I also tried using node-sshpk because I saw that it supports ed25519, but I didn't find a way to connect to the linux server.

Does anyone know a way to connect to the server using ed25519 keys?

bobo
  • 31
  • 4

1 Answers1

0

There is an open issue in the ssh2 package.


If you want to use the specific ed25519 format, look at the npm package ed25519.

Orelsanpls
  • 22,456
  • 6
  • 42
  • 69
  • I looked at the npm package ed25519 but I couldn't find any function for connecting to the server. I only saw functions for signing and verifying a message. Do you know if there is a way to do this? – bobo Mar 08 '19 at 08:14