A
alcool
hi,
I would like to execute a command and read the output generated
// Create a instance and connect
SshClient ssh = new SshClient();
ssh.setSocketTimeout(30000);
ssh.connect("192.168.1.129");
PasswordAuthenticationClient pwd = new
PasswordAuthenticationClient();
pwd.setUsername("root");
pwd.setPassword("kondor");
// Execute command
session.executeCommand("date +%Y-%m-%d");
// here I would like to read the current date on the server
thx
bye
I would like to execute a command and read the output generated
// Create a instance and connect
SshClient ssh = new SshClient();
ssh.setSocketTimeout(30000);
ssh.connect("192.168.1.129");
PasswordAuthenticationClient pwd = new
PasswordAuthenticationClient();
pwd.setUsername("root");
pwd.setPassword("kondor");
// Execute command
session.executeCommand("date +%Y-%m-%d");
// here I would like to read the current date on the server
thx
bye