>> SSH user@host -i key.pem
There are many ways to do this - here is the simplest
// Do it ONCE in your main method
SshClient client = SshClient.setupDefaultClient();
client.start();
// to connect and authenticate in the code
try (ClientSession session = client.connect(user, host)
Lyor G. ,
Thanks very much for this.
I’ve haven’t managed to spend as much time on it as I would like just yet, but
cutting it down has helped already.
The item of code you mentioned does work as you said it does, and I can call it
fine in most circumstances.
However, and I could be looking at