Skip to content

Instantly share code, notes, and snippets.

@kapb14
Created March 14, 2016 08:07
Show Gist options
  • Select an option

  • Save kapb14/2772d1c7e64ed2454a84 to your computer and use it in GitHub Desktop.

Select an option

Save kapb14/2772d1c7e64ed2454a84 to your computer and use it in GitHub Desktop.
callback подключение по SSH через туннель
#
# >> добавить в /etc/rc.local (или что-то типа того):
#
# turn on verbose logging
export AUTOSSH_DEBUG
# Sets the connection monitoring port.
export AUTOSSH_PORT=61000
# specifies the connection poll time in seconds; default is 600 seconds.
export AUTOSSH_POLL=300
ASSH_PORT=61000
ASSH_OPTS_1="PubkeyAuthentication=yes"
ASSH_OPTS_2="PasswordAuthentication=no"
ASSH_KEY="/root/.ssh/id_rsa"
ASSH_CALLBACK_PORT=22202
/usr/bin/autossh -N -f -o $ASSH_OPTS_1 -o $ASSH_OPTS_2 -i $ASSH_KEY -R $ASSH_CALLBACK_PORT:localhost:22 [email protected] &
#
# >> подключаться с jump.host.my
#
ssh -l root -p 22202 localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment