// quickest version - allow any host ID and search for pw in JavaX-Secret // not sure which encoding is used for input and output static S quickSSH2(S user, S host, S command, int timeoutSeconds) ctex { final SSHClient client = sshLogin(user, host); try { final Session session = client.startSession(); //print("Started session"); try { //print("Executing command: " + command); final Session.Command cmd = session.exec(command); S output = IOUtils.readFully(cmd.getInputStream()).toString(); cmd.join(timeoutSeconds, TimeUnit.SECONDS); ret output; } finally { session.close(); } } finally { client.disconnect(); } }