Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
projects:ssh_reverse_tunnel [2016/06/09 23:00] over23 [Active] [project] ssh_reverse_tunnel : note for mac users : not to turn of wiifi when screensaver is on |
projects:ssh_reverse_tunnel [2016/06/10 00:29] (current) over23 |
||
---|---|---|---|
Line 58: | Line 58: | ||
<code> | <code> | ||
- | #!/bin/bash | + | #!/bin/bash -x |
createTunnel() { | createTunnel() { | ||
##### fill in vars | ##### fill in vars | ||
- | RemoteHost="INSERT.IP.HERE.NOW" | + | RemoteHost="IP_HERE" |
- | ServerUser="NAME_FOR_REMOTE_USER" | + | ServerUser="NICK_HERE" |
##### are wars filled? | ##### are wars filled? | ||
- | | + | |
- | /usr/bin/ssh -N -R 2222:localhost:22 ${ServerUser}@${RemoteHost} | + | /usr/bin/ssh -N -R 2222:localhost:22 ${ServerUser}@${RemoteHost} & |
if [[ $? -eq 0 ]]; then | if [[ $? -eq 0 ]]; then | ||
echo Tunnel to RemoteHost IP: ${RemoteHost} created successfully | echo Tunnel to RemoteHost IP: ${RemoteHost} created successfully |