0

I'm venturing beyond Ubuntu for the first time, and chose Antergos to ease my way into wider world of Linux. Everything's going pretty smoothly and pacman is becoming familiar, but autossh seems to be having a problem:

On Antergos:

[tbrowne@redbrix1 ~]$ autossh -p 52222 tbrowne@www.xxxxx.com
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). Default is 30 seconds; use of -f
                          flag sets this to 0.
    AUTOSSH_LOGFILE     - file to log to (default is to use the syslog
                          facility)
    AUTOSSH_LOGLEVEL    - level of log verbosity
    AUTOSSH_MAXLIFETIME - set the maximum time to live (seconds)
    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
                          stderr

[tbrowne@redbrix1 ~]$ 

On Ubuntu 16.04:

tbrowne@calculon:~$ autossh -p 52222 tbrowne@www.xxxxx.com
  ____      _     _      _                   _    
 / ___|   _| |__ (_) ___| |_ _ __ _   _  ___| | __
| |  | | | | '_ \| |/ _ \ __| '__| | | |/ __| |/ /
| |__| |_| | |_) | |  __/ |_| |  | |_| | (__|   < 
 \____\__,_|_.__/|_|\___|\__|_|   \__,_|\___|_|\_\


Welcome to ARMBIAN 5.31 stable Debian GNU/Linux 8 (jessie) 4.11.6-sunxi   
System load:   0.05 0.05 0.01   Up time:       1 day        
Memory usage:  17 % of 2012MB   IP:            192.168.1.192
CPU temp:      37°C             HDD temp:      30°C             
Usage of /:    7% of 110G       storage/:      7% of 110G       

[ 0 security updates available, 2 updates total: apt upgrade ]
Last check: 2017-08-30 00:00

[ General system configuration: armbian-config ]
Last login: Wed Aug 30 15:21:31 2017 from 83-244-211-54.cust-83.exponential-e.net
                    ____
      ___======____=---=)
    /T            \_--===)
    [ \ (0)   \~    \_-==)
     \      / )J~~    \-=)
      \\___/  )JJ~~~   \)
       \_____/JJJ~~~~    \
       / \  , \J~~~~~     \
      (-\)\=|\\\~~~~       L__
      (\\)  (\\\)_           \==__
       \V    \\\) ===_____   \\\\\\
              \V)     \_) \\\\JJ\J\)
                          /J\JT\JJJJ)
                          (JJJ| \UUU)
                           (UU)
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
tbrowne@cubietruck ~> 

I want to use autossh to create a reverse port forward, but it seems to give me a syntax error whenever I try anything with it.

I'm using autossh 1.4e on both. Plain old (non-auto) ssh works fine on both. What's going on?

  • could you add the autossh --help from both please? Maybe I'm guessing right now but I believe that the syntax that you are looking on antergos would be something like autossh -M 52222 tbrowne@www.xxxxx.com – Christopher Díaz Riveros Aug 30 '17 at 14:03
  • @ChistopherDiazRiveros Just did an autossh -h on Ubuntu and it is identical to the help screen thrown up in the question by the Antergos example (usage: ...). Also M is for the monitor port whereas what I am specifying is the port number to ssh into on the remote. I my setup port 52222 is forwarded to 22 by the router. – Thomas Browne Aug 30 '17 at 14:25
  • ok, could you please echo AUTOSSH_PORT and AUTOSSH_DEBUG on both systems? – Christopher Díaz Riveros Aug 30 '17 at 14:40
  • Nope, on both the Ubuntu and Antergos systems, $AUTOSSH_PORT and $AUTOSSH_DEBUG are blank. – Thomas Browne Aug 30 '17 at 15:17
  • The documentation of autossh doesn't mention -p as a valid option. Are you sure you aren't running a different program (maybe a local script) called autossh? What's the output of type autossh? – Gilles Aug 31 '17 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.