This question already has an answer here:
- JSch to add private key from a string 1 answer
I need to connect to an sftp server from an hadoop cluster. I would like to know if there is a way to load an identity from a private key stored in hdfs. Actually it seems that the JSch object accepts only a local path:
try {
String privateKeyPath = "hdfs://namenode:8020/path/to/privatekey"; // need this one to be an hdfs path
JSch jsch = new JSch();
jsch.addIdentity(privateKeyPath);
// [..]
}
catch (Exception ex) {
// [..]
}
Any idea?