Skip to content

Instantly share code, notes, and snippets.

@designermonkey
Forked from thomasfr/autossh.service
Created December 6, 2015 12:28
Show Gist options
  • Select an option

  • Save designermonkey/bf0a02617ced4e5a9dc0 to your computer and use it in GitHub Desktop.

Select an option

Save designermonkey/bf0a02617ced4e5a9dc0 to your computer and use it in GitHub Desktop.

Revisions

  1. Thomas Fritz revised this gist Mar 22, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion autossh.service
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ User=autossh
    # -M 0 --> no monitoring
    # -N Just open the connection and do nothing (not interactive)
    # LOCALPORT:IP_ON_EXAMPLE_COM:PORT_ON_EXAMPLE_COM
    ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 4422 -l autossh remote.example.com -L 7474:127.0.0.1:7474 -i /home/autossh/.ssh/id_rsa
    ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 22 -l autossh remote.example.com -L 7474:127.0.0.1:7474 -i /home/autossh/.ssh/id_rsa

    [Install]
    WantedBy=multi-user.target
  2. Thomas Fritz created this gist Mar 22, 2014.
    15 changes: 15 additions & 0 deletions autossh.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    [Unit]
    Description=Keeps a tunnel to 'remote.example.com' open
    After=network.target

    [Service]
    User=autossh
    # -p [PORT]
    # -l [user]
    # -M 0 --> no monitoring
    # -N Just open the connection and do nothing (not interactive)
    # LOCALPORT:IP_ON_EXAMPLE_COM:PORT_ON_EXAMPLE_COM
    ExecStart=/usr/bin/autossh -M 0 -N -q -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -p 4422 -l autossh remote.example.com -L 7474:127.0.0.1:7474 -i /home/autossh/.ssh/id_rsa

    [Install]
    WantedBy=multi-user.target