I am getting below error when connecting ssh server with identity file in node js
Error: Unable to read the Private Key File
my code:
driver = require('node-ssh');
ssh = new driver({
host: '192.168.*.*',
username: 'user',
password: 'password',
privateKey : require('fs').readFileSync('/tmp/my_key')
});
ssh.connect().then(function() {
/*
some code
*/
},function(error) {
console.log(error);
});
But if i connect from my linux machine, it is connected.
ssh -i /tmp/my_key [email protected].*.*
Please give any solution for this.