Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running yum installed autossh 1.4a on fedora core 15 with the latest updates.

This works:

ssh -L 9000:valid.fqdn:80 another_valid_fqdn

However, autossh fails and prints its usage message:

ssh -L 9000:valid.fqdn:80 another_valid_fqdn

usage: autossh [-V] [-M monitor_port[:echo_port]] [-f] [SSH_OPTIONS]

-M specifies monitor port. May be overridden by environment
   variable AUTOSSH_PORT. 0 turns monitoring loop off.
   Alternatively, a port for an echo service on the remote
   machine may be specified. (Normally port 7.)
-f run in background (autossh handles this, and does not
   pass it to ssh.)
-V print autossh version and exit.

Environment variables are: AUTOSSH_GATETIME - how long must an ssh session be established before we decide it really was established (in seconds) AUTOSSH_LOGFILE - file to log to (default is to use the syslog facility) AUTOSSH_LOGLEVEL - level of log verbosity AUTOSSH_MAXSTART - max times to restart (default is no limit) AUTOSSH_MESSAGE - message to append to echo string (max 64 bytes) AUTOSSH_PATH - path to ssh if not default AUTOSSH_PIDFILE - write pid to this file AUTOSSH_POLL - how often to check the connection (seconds) AUTOSSH_FIRST_POLL - time before first connection check (seconds) AUTOSSH_PORT - port to use for monitor connection AUTOSSH_DEBUG - turn logging to maximum verbosity and log to

Any ideas how I might get autossh to work? According to the usage message it should just take ssh options directly.

share|improve this question
    
Monitor port is not optional apparently. Try autossh -M 0 -L 9000:valid.fqdn:80 another_valid_fqdn –  AndreasM Feb 9 '12 at 16:29
    
@AndreasM That works! Thanks. Add it as an answer and I'll mark it answered. –  David Watson Mar 8 '12 at 17:48

1 Answer 1

up vote 3 down vote accepted

The monitor port is apparently not optional. Try autossh -M 0 -L 9000:host:80 ssh_host

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.