Skip to content

Commit

Permalink
Add SSH_OPTIONS pararameter for tunnels (issue jnovack#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkeuz committed Aug 14, 2021
1 parent 816f453 commit f4bc129
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,16 @@ Sets the threshold of alive messages after which the connection is terminated an

Additional details are available from [`ssh_config(5)`](https://linux.die.net/man/5/ssh_config)

#### SSH_OPTIONS

Sets additional parameters to `ssh` connection. Supports more than one parameter.

Examples:
- SSH_OPTIONS="-o StreamLocalBindUnlink=yes" for recreate socket if it exists
- SSH_OPTIONS="-o StreamLocalBindUnlink=yes -o UseRoaming=no" for multiple parameters

Additional details are available from [`ssh_config(5)`](https://linux.die.net/man/5/ssh_config)

#### Additional Environment variables

- [`autossh(1)`](https://linux.die.net/man/1/autossh)
Expand Down
1 change: 1 addition & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:
- SSH_TARGET_HOST=203.0.113.100
- SSH_TARGET_PORT=22
- SSH_TUNNEL_PORT=11111
- SSH_OPTIONS="-o StreamLocalBindUnlink=yes -o UseRoaming=no"
- SSH_KEY_FILE=/opt/id_rsa
- SSH_KNOWN_HOSTS_FILE=/dev/null
- SSH_STRICT_HOST_IP_CHECK=false
Expand Down
1 change: 1 addition & 0 deletions rootfs/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ COMMAND="autossh "\
"-o ServerAliveInterval=${SSH_SERVER_ALIVE_INTERVAL:-10} "\
"-o ServerAliveCountMax=${SSH_SERVER_ALIVE_COUNT_MAX:-3} "\
"-o ExitOnForwardFailure=yes "\
"${SSH_OPTIONS} "\
"-t -t "\
"${SSH_MODE:=-R} ${SSH_BIND_IP}:${SSH_TUNNEL_PORT}:${SSH_TARGET_HOST}:${SSH_TARGET_PORT} "\
"-p ${SSH_REMOTE_PORT:=22} "\
Expand Down

0 comments on commit f4bc129

Please sign in to comment.