Having trouble sending long commands in SSH or telnet
Posted by Van Glass on 11 October 2007 08:45 PM
When using the SshSession or TelnetSession classes you may find that when sending long commands using the send(String message) or sendWait(String message, String prompt) methods that the server only receives part of the command. This is typically due to line length limitations imposed by the server. To avoid this issue you will need to truncate your command into multiple parts using a combination of the sendRaw and send or sendWait method.

For example:

session.sendRaw("command part1");
session.sendRaw("command part2");
session.send("remainder of command");

(153 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako fusion