Telnet Timeout


 
Thread Tools Search this Thread
Operating Systems Linux Telnet Timeout
# 1  
Old 12-24-2009
Telnet Timeout

is there a way to add a timeout parameter to telnet when connecting to any IP address?

like, if this IP doesn't respond within 10 seconds, abort.

thanks

i'm looking for something like this:

telnet gaggaga.com 443 -t 10
# 2  
Old 12-27-2009
so telnet doesn't have a command line timeout parameter?
# 3  
Old 12-27-2009
Correct
# 4  
Old 12-27-2009
If you have expect you could implement something like this:

Code:
#!/usr/bin/expect --

set timeout [lindex $argv 0] 
set machine [lindex $argv 1]

spawn telnet $machine

expect {
  "ogin" interact
  timeout  exit 
  }

The use it like this:

Code:
./script_name <timeout> <hostname>

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

[SOLVED] Telnet timeout issue

I have telnet configured in /etc/inetd.conf as below: telnet stream tcp6 nowait root /usr/lbin/telnetd telnetd -b /etc/issue -n20 When i restart the service telnetd shows with only the -b option: ps -ef|grep telnetd|grep -v grep root 24397 1 0 10:42:35 pts/ta 0:00... (1 Reply)
Discussion started by: Tommyk
1 Replies

2. Shell Programming and Scripting

ping and telnet timeout

Hello, I need help, I have the following which save in the result file ping and telnet:port test. Basically the script works but I should implement a check on ping and telnet command so that ping has 5 seconds threshold and telnet (more important) 10 seconds. Over that threshold ping and... (0 Replies)
Discussion started by: marmellata
0 Replies

3. Solaris

rlogin, telnet connections timeout

Hi, I have a Sun Ultra 5 desktop with Solaris 8. When I telnet/rlogin into any other host, the connection closes after few hours of inactivity. I also have another Windows box which I use rarely. But when I telnet/rlogin into the same hosts using putty, the connection stays for days without any... (5 Replies)
Discussion started by: dr_gsb
5 Replies

4. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

5. Forum Support Area for Unregistered Users & Account Problems

tinylogin telnet idle timeout

Hello, I have a busybox with tinylogin. How can I log user out when I found the telnet session is idle for 10 seconds? I set TMOUT=10 export TMOUT in /etc/profile I found it doesn't work for me. Can anybody help me? Thanks a lot! jing (1 Reply)
Discussion started by: jing han
1 Replies

6. Red Hat

telnet idle timeout on Redhat kernel 2.4.35.4

Hello, I've searched this forum for telnet idle timeout problem. I tried to set timeout parameters in /etc/profile readonly TMOUT=10 export TMOUT This doesn't work for Redhat kernel 2.4.35.4. It's really frustrating. Can anybody tell me what else I could try? Thanks a lot! jing (0 Replies)
Discussion started by: jing han
0 Replies

7. Solaris

Disable telnet timeout

Hi, Can someone help me how I can disable telnet timeout? I'm connecting remotely to some machines and after some time my telnet connection was closed. How can I disable this so that I'm always connected to those machines? Thanks! (2 Replies)
Discussion started by: ayhanne
2 Replies

8. AIX

how to change telnet timeout setting

Hi all Can any one solve my problem? I want to change the default timeout setting for telnet in aix, pls help me. (1 Reply)
Discussion started by: vjm
1 Replies

9. UNIX for Dummies Questions & Answers

solaris telnet idle timeout

I have put TMOUT=1800;export TMOUT in the /etc/profile, put it does not work, by the way the root default shell is sh. but I wana every one including root to terminate the session after setting idle for 1800 seconds. thank for the help. (1 Reply)
Discussion started by: kahn630
1 Replies

10. UNIX for Dummies Questions & Answers

telnet session timeout

hi, we can set something such that if the user has been idle for a while, it will auto disconnect. where to do so? thanks (6 Replies)
Discussion started by: yls177
6 Replies
Login or Register to Ask a Question