Can we use JSch for SSH key-based communication?
It is possible. Have a look at JSch.addIdentity(…) This allows you to use key either as byte array or to read it from file. import com.jcraft.jsch.Channel; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; public class UserAuthPubKey { public static void main(String[] arg) { try { JSch jsch = new JSch(); String user = “tjill”; String host … Read more