telnet

expect - telnet connection

谁说我不能喝 提交于 2021-02-08 08:20:30
问题 I'm trying to create a simple telnet connection script. I spawn telnet process. Depending on the version, it may or may not ask for password. After that It asks for username and password and rulese acceptation. After successful login it prompts for command. However, thing I wrote does not work. #/usr/bin/expect -f set IP [lindex $argv 0] set timeout 10 set send_slow {10 .5} log_user 1 spawn telnet -l cli $IP expect { timeout { puts "Network Connection Problem" close } "Password:" { send -s --

expect - telnet connection

偶尔善良 提交于 2021-02-08 08:19:36
问题 I'm trying to create a simple telnet connection script. I spawn telnet process. Depending on the version, it may or may not ask for password. After that It asks for username and password and rulese acceptation. After successful login it prompts for command. However, thing I wrote does not work. #/usr/bin/expect -f set IP [lindex $argv 0] set timeout 10 set send_slow {10 .5} log_user 1 spawn telnet -l cli $IP expect { timeout { puts "Network Connection Problem" close } "Password:" { send -s --

replacing telnet with ssh

為{幸葍}努か 提交于 2021-02-07 20:34:16
问题 I have some programs that use the Net::Telnet module to connect to several servers. Now the administrators have decided to replace the Telnet service for SSH, keeping everything else like before (for example the user accounts) I've taken a look at Net::SSH2 and I see that I would have to change most part of the programs. Do you know of other SSH modules, better suited for this same replacement? The client is a Windows box (ActiveState Perl or Cygwin Perl) 回答1: Net::OpenSSH! And check the

How do I send telnetlib control + c command in python

此生再无相见时 提交于 2021-02-07 09:13:08
问题 I am trying to send control + c command in python using telnetlib library. Currently I am doing tn.write('^]') But the code above doesn't seem to work. Any clue on What I should use? 回答1: Try ASCII characters of control+c to the telnet connection below:- tn.write('\x03') 回答2: ctrl+a = decimal 1 ctrl+b = decimal 2 ctrl+c = decimal 3 and so on.. to ctrl+x = decimal 24 ctrl+y = decimal 25 ctrl+z = decimal 26 escape = 27 etc Still, for those who will need this in the future Arrow keys are (3

How to toggle Tcl interact and expect for telnet automation?

纵然是瞬间 提交于 2021-01-29 15:59:48
问题 Similar to but different from autoexpect in that autoexpect will always produce the same output for any given input. Whereas, trying to allow for user input sometimes at least. This works in that it passes control back to the user as below: thufir@dur:~/NetBeansProjects/spawnTelnet/telnet$ thufir@dur:~/NetBeansProjects/spawnTelnet/telnet$ tclsh main.tcl got nyc spawn telnet rainmaker.wunderground.com Trying 35.160.169.47... Connected to rainmaker.wunderground.com. Escape character is '^]'. --