I know this is old question, but I cant find anything on google. Is there any good software for centrally scripting telnet and ssh? Basically the following components: Telnet/SSH client, GUI, Server & Switch detection and support, pre-defined script templates, error reporting, logging, authenticating, and it's universal and not product specific. ps. It's not product discussion, but a tool / solution question.
Asked
Active
Viewed 200 times
1 Answers
0
If I understand the question properly, Expect is the answer. You can even see some telnet and ssh examples on its Wikipedia page.
Here is for example a simple Expect script that prints the environment variables on a remote server:
#! /usr/bin/expect
spawn telnet 127.0.0.1
# Send username
expect -nocase "login:"
send "myuser\r"
# Send password
expect -nocase "password: "
send "123456\r"
# Wait for a shell prompt
expect -re {\$}
# Get the environment variables
send "env\r"
# Wait for a prompt again and exit
expect -re {\$}
exit

Vladimir Blaskov
- 6,183
- 1
- 27
- 22
-
Many thanks, so I do server-side expect CGI, and the desktop/mobile client, so I can click buttons, this should be OK so I can run two clients no problem in two different rooms. – Andrew Smith Jul 04 '12 at 11:18