Not sure if there is an SSH option for that, however, there is the 'netcat' utility, which you can connect to a certain post, and you can set a timeout.
For instance:
So to check to see if ssh will respond withing 5 seconds, so the following:
The '-z' option will make it disconnect as soon as it makes a connection to the port, and of course '-w' is to set the timeout in seconds.
If it does not connect, it will return a non-zero exit status, in which case, you would know to raise your alarm.
Would there be any reason for why a 'read ans' would not wait for a user's response (i.e user has to hit a key to continue)? I know for sure that it is doing everything else in that part of my 'if' statement but it doesn't wait for me to hit a key before continuing.
The strange thing is that... (4 Replies)
Hi
Is it possible to have a script run in a loop (waiting for a change of state in the network interface), and if the loop continues for five minutes, to have it email the admin, and carry on in the loop?
Here is my loop:
#!/bin/bash
STATE=`echo "show... (3 Replies)
I have a text file which contain all the parameters need for scheduled jobs, then this "control" script would be called everynight at certain time
while read line
do
$myScript.sh $line &
pid=$!
i=`expr $i + 1`
done < $list
then I need to wait until all... (1 Reply)
I am trying to write an expect script that trys to telnet, if telnet fails, trys to ssh to a remote network devices.
The script works fine until the following is received :
spawn telnet 10.3.2.24
Trying 10.3.2.24...
telnet: connect to address 10.3.2.24: Connection refused
10.3.2.24 is... (2 Replies)
I have a script that runs Compressor and converts the file then I want it to inject the file with Flvtool2. My script works fine but the flvtool2 is starting too early. I have tried to put it in the background by putting a "&" sign at the end and then put a "wait" on a new line. Anyone have any... (2 Replies)
My shell script is not waiting. I right click on a file and say convert it to whatever and it runs this script. It converts it using Compressor but I want it to wait until it is 100% done before moving on and it is not waiting. I have tried to put it in the background and using "wait". I have tried... (10 Replies)
Hi.
I'm trying to automate access to an Amazon Web Services machine instance. What this means is that my script is trying to use ssh to connect to a new server every time. I know the RSA fingerprint of my new server through an out-of-band channel.
I would like to capture the RSA fingerprint... (0 Replies)
Hi - I am getting the error
`Error reading response length from authentication socket'
when I ssh from my cluster to another cluster, and then back to my cluster. It doesn't seem to affect anything, but it's just annoying that it always pops up and tends to confuse new users of the cluster. I... (1 Reply)
Hello,
I have a script that contains the command "whois 1.2.3.4"
Sometimes this command takes far too long to produce any output and as a result the rest of the script is not executed.
Can anyone suggest a method so that if no output is produced after say 2 seconds the script skips that... (2 Replies)
Hi,
I am writing a little script to update a parameters on JMQ. however the JMQ requires a "y" confirmation to be input as part of the cmd I am running. However I want run this script to offline with no input from a user.
it works if a I create a file with with just y in it and pass that in... (3 Replies)
Discussion started by: shropshirehobbi
3 Replies
LEARN ABOUT DEBIAN
corkscrew
corkscrew(1) Networking corkscrew(1)NAME
corkscrew - Tunnel TCP connections through HTTP proxies
SYNOPSIS
corkscrew PROXY PROXYPORT TARGETHOST TARGETPORT [AUTH_FILE]
DESCRIPTION
corkscrew is a simple tool to tunnel TCP connections through an HTTP proxy supporting the CONNECT method. It reads stdin and writes to std-
out during the connection, just like netcat. It can be used for instance to connect to an SSH server running on a remote 443 port through a
strict HTTPS proxy.
PROXY
The name of the host running the HTTP proxy.
PROXYPORT
The port on which to connect on the proxy.
TARGET
The host to reach through the proxy.
TARGETPORT
The port to connect to on the target host.
AUTH_ FILE
The auth file is made of one single line containing your username and password in the form
username:password
OPTIONS
None.
EXAMPLES
The common usage of corkscrew is to put the following line in ~/.ssh/ssh_config:
ProxyCommand corkscrew proxy proxyport %h %p [<path to auth_file>]
This will let the ssh connection go through the proxy with the help of corkscrew.
ENVIRONMENT
None.
FILES
None.
SEE ALSO ssh_config(5)AUTHORS
Program was written by Pat Padgett <agroman@agroman.net>.
This manual page was written by Laurent Fousse <laurent@komite.net> for the Debian GNU system (but may be used by others). Updated by Jari
Aalto <jari.aalto@cante.net>. Released under license GNU GPL version 2 or (at your option) any later version. For more information about
license, visit <http://www.gnu.org/copyleft/gpl.html>.
corkscrew 2012-03-26 corkscrew(1)