Class SSHSession

Extends ch.dunes.ssh2.SSH2AbstractSession
SSH Session to username@host:port. This object replace the old 'SSHCommand' object.


Name Type Description
cmd String Command to execute
error String Command error if any
exitCode String The exit code of the last command (execution channel). Values are 0 if successful, -1 for initializing, and positive number for an error.
output String Command output if any
pty String RFC4254 6.2. Requesting a Pseudo-Terminal
soTimeout String Socket timeout
state String Execution state
terminal String Set the terminal type, for example vt100


Name Returns
SSHSession(String host, String username) constructor
SSHSession(String host, String username, Number port) constructor
addEnvironment(String key, String value) void
connectWithIdentidy(Path privateKeyPath, SecureString passphrase) void
connectWithIdentity(Path privateKeyPath, SecureString passphrase) void
connectWithPassword(SecureString password) void
connectWithPasswordOrIdentity(boolean isPassword, SecureString password, Path privateKeyPath) void
disconnect() void
execute() void
executeAndLog(Path file) void
executeAndLog(String ) void
executeCommand(String cmd, boolean wait) void
executeCommand(String ) String
find(String , String , Number ) String[]
findAll(Path basePath, String pattern) String[]
findAll(String , String ) String[]
findDir(Path basePath, String pattern) String[]
findDir(String , String ) String[]
findFile(Path basePath, String pattern) String[]
findFile(String , String ) String[]
getEncoding() Object
getFile(Path remoteFile, Path localFile) Number
getFile(String , String ) Number
getPtyType() String
listAll(Path basePath) String[]
listAll(String ) String[]
listDir(Path basePath) String[]
listDir(String ) String[]
listFile(Path basePath) String[]
listFile(String ) String[]
main(String[] ) void
putEnv(String , String ) void
putFile(Path localFile, Path remoteFile) Number
putFile(String , String ) Number
setEncoding(String encoding) void
setPtyType(String ) void
setUserInfo(Object userInfo) void

Returned by


Referenced in