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?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.