16 lines
397 B
Bash
16 lines
397 B
Bash
#!/bin/sh
|
|
|
|
ssh-keyscan -p ${SSH_PORT:-22} ${SSH_HOST} >> /root/.ssh/known_hosts 2>/dev/null
|
|
|
|
exec autossh \
|
|
-M 0 \
|
|
-N \
|
|
-D 0.0.0.0:1080 \
|
|
-o "ServerAliveInterval=30" \
|
|
-o "ServerAliveCountMax=3" \
|
|
-o "ExitOnForwardFailure=yes" \
|
|
-o "StrictHostKeyChecking=no" \
|
|
-o "ConnectTimeout=10" \
|
|
-p ${SSH_PORT:-22} \
|
|
-i /root/.ssh/id_rsa \
|
|
${SSH_USER}@${SSH_HOST} |