Setting your prompts |
The login, password and shell prompts are needed by the TelnetSession class in order to know when the telnet server is ready to accept data. By default the login prompt is "login:", the password prompt is "Password:" and the shell prompt is "$". If the prompts on your server are different than the default values then you will need to change these values in the TelnetSession instance prior to establishing a connection.
Example
// set login prompt session.setLoginPrompt("user:");
// set password prompt session.setPasswordPrompt("pass:");
// set shell prompt session.setShellPrompt(">"); |