timeout option in ssh or rsh??
Hi,
Is any one aware of timeout option for rsh or ssh? I need it for a script.All i want is to to rsh\ssh a workstation and exit it from it after the mentioned time:). Thanks for the help! |
I'm not aware of such an option. Guess you'll need to write a wrapper that starts your
script and back-grounds it, and then shoots it dead. |
Quote:
2. Have an interval timer increment the counter, read the result, and exit the session once the inactive time criterion is met. To do this, you need threads, so Bash is out. Use Ruby, Python, something that supports threads and is reliable. The user would not see the interaction in any way out of the ordinary -- Ruby or Python would present the user's entries and the server's replies in the normal way. It would be nice if the script provided a warning before unplugging the user, who might have started a long, critical process that shouldn't be interrupted. |
Thanks for the reply :) can you tell me more regarding that
|
Quote:
|
bash TMOUT setting in /etc/profile
http://linuxgazette.net/issue58/sharma.html |
Please Help
How do you add timeout option for RSH command???
I have a script that runs some network tests such as traceroute over rsh. But when rsh attempts to establish a connection... it just hangs there. So my script will never finish and gets stuck at the command with rsh. I am using the following command in my script: rsh server1 -l user1 -t 120 traceroute 192.168.1.245 The above command should have timed out in 2 mins when it can't connect. Thanks! |
How about using ssh:
user ssh -o ConnectTimeout=120 server |
If you wrote it in Perl (or used a Perl wrapper) you can use the ARLM signal
Code:
eval { |
Thanks alghazi & chrism01
SSH has been disabled. So I am stuck rsh/rlogin or telnet. As for the PERL, I wrote my script in bash. =( I have PERL as my next skill to pick up list. Is there any other ideas? |
If you insist on using bash, Tinkster's soln (post #2) is the way to go
|
All times are GMT -5. The time now is 10:45 PM. |