Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.5.1
-
None
Description
I tried to do this:
SshClient.setUpDefaultSimpleClient().use { ssh -> ssh.sessionLogin("server.company.com", "user", "p@ssw0rd").use { session -> println(session.executeRemoteCommand("id")) println(session.executeRemoteCommand("ps aux")) } }
(If you are not familiar with the syntax, it is Kotlin. The use works like a try-with-resources, I think the rest should be pretty obvious)
This is supposed to work, isn't it?
Yet it does not work.
The first command works fine and then for the second command I get java.rmi.RemoteException: No exit status returned for command=ps aux.