1 #usage: autossh [-V] [-M monitor_port[:echo_port]] [-f] [SSH_OPTIONS]
3 # -M specifies monitor port. May be overridden by environment
4 # variable AUTOSSH_PORT. 0 turns monitoring loop off.
5 # Alternatively, a port for an echo service on the remote
6 # machine may be specified. (Normally port 7.)
7 # -f run in background (autossh handles this, and does not pass it to ssh.)
8 # -V print autossh version and exit.
10 #Environment variables are:
11 # AUTOSSH_LOGLEVEL - level of log verbosity
14 # AUTOSSH_MESSAGE - message to append to echo string (max 64 bytes)
15 # AUTOSSH_PIDFILE - write pid to this file
16 # AUTOSSH_FIRST_POLL - time before first connection check (seconds)
19 # AUTOSSH_POLL - how often to check the connection (seconds)
21 # AUTOSSH_PORT - port to use for monitor connection
23 # AUTOSSH_GATETIME - how long must an ssh session be established
24 # before we decide it really was established
25 # (in seconds). Default is 30 seconds; use of -f
26 # flag sets this to 0.
28 # AUTOSSH_LOGFILE - file to log to (default is to use the syslog facility)
29 #AUTOSSH_LOGFILE=$HOST.log
31 # AUTOSSH_DEBUG - turn logging to maximum verbosity and log to stderr
34 # AUTOSSH_PATH - path to ssh if not default
35 #AUTOSSH_PATH=/usr/local/bin/ssh
37 # AUTOSSH_MAXSTART - max times to restart (default is no limit)
40 # AUTOSSH_MAXLIFETIME - set the maximum time to live (seconds)
42 AUTOSSH_PIDFILE=/var/run/autosshd/server2.pid
43 AUTOSSH_LOCKFILE=server2.lck
44 AUTOSSH_LOGFILE=/var/lib/autosshd/autosshd.log
48 REMOTESSH_USER=_autossh
52 #AUTOSSH_PORT parameter must be unique for each connection and can not be 0
57 AUTOSSH_OPTIONS=" -M ${AUTOSSH_PORT} -R ${REMOTE_PORT}:localhost:${LOCAL_PORT} -f ${REMOTESSH_USER}@${HOST}"