Advertisement
J2897

[Cygwin] Tunnel to Router

Jul 2nd, 2017
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. #!/bin/bash
  2. clear
  3.  
  4. # This will allow you to tunnel into a host and access the router's
  5. # web admin panel without having to enable remote access.
  6. #
  7. # How to create a shortcut...
  8. #
  9. #   Target:     C:\cygwin\bin\bash.exe --login -c "/cygdrive/c/Users/J2897/Code/Bash/tunnel_router.bash"
  10. #   Start in:   C:\cygwin\bin
  11.  
  12. ssh -i "$(cygpath "$USERPROFILE\Keys\Alfa\id_rsa")" -N -L 9000:192.168.0.1:80 -o "ExitOnForwardFailure yes" -p 22 J2897@example.org &
  13. PID=$!
  14. cygstart "$(cygpath "C:\Program Files\Google\Chrome\Application\chrome.exe")" --profile-directory=Default --incognito http://127.0.0.1:9000/
  15. read -n1 -r -p "Press any key to close the tunnel..."
  16. kill $PID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement