mirror of
https://github.com/hackerschoice/thc-tips-tricks-hacks-cheat-sheet.git
synced 2026-07-11 05:03:42 +02:00
indendation
This commit is contained in:
@@ -281,12 +281,12 @@ On the host behind NAT: Create a reverse SSH tunnel to [ssh-j.com](http://ssh-j.
|
||||
## Cut & Paste on the host behind NAT.
|
||||
ssh_j()
|
||||
{
|
||||
local pw
|
||||
pw=$1
|
||||
local pw
|
||||
pw=$1
|
||||
[[ -z $pw ]] && { pw=$(head -c64 </dev/urandom | base64 | tr -d -c a-z0-9); pw=${pw:0:12}; }
|
||||
echo "Press Ctrl-C to stop this tunnel."
|
||||
echo -e "To connect to this host: \e[0;36mssh -J ${pw}@ssh-j.com ${USER:-root}@${pw}\e[0m"
|
||||
ssh -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes ${pw}@ssh-j.com -N -R ${pw}:22:${2:-0}:${3:-22}
|
||||
echo -e "To connect to this host: \e[0;36mssh -J ${pw}@ssh-j.com ${USER:-root}@${pw}\e[0m"
|
||||
ssh -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes ${pw}@ssh-j.com -N -R ${pw}:22:${2:-0}:${3:-22}
|
||||
}
|
||||
|
||||
ssh_j # Generates a random tunnel ID [e.g. 5dmxf27tl4kx] and keeps the tunnel connected
|
||||
|
||||
Reference in New Issue
Block a user