|---------------|
| | |---------------|
| | | |
| Host | 1. SSH Tunnel | |
| Behind |==================>| My |
| Firewall(A) |<------------------| Device(B) |
| | 2. Reverse SSH | |
| |==================>| |
|---------------| |---------------|
- Install & run SSHD
- SSH from A into B
# -N: -Do not execute a remote command. This is useful for just forwarding ports.
# -f: Requests ssh to go to background just before command execution.
ssh [-Nf] -R B_PORT:localhost:A_SSHD_PORT B_USER@B_IP
- SSH from B into A via tunnel we made above
ssh -p B_PORT A_USER@localhost
- Kill background SSH tunnel
ps aux | grep ssh
kill -9 PID
- List ports that are currently listening
netstat -tulpn | grep LISTEN
- ???
nc -l -p SOME_PORT
- https://unix.stackexchange.com/questions/115897/whats-ssh-port-forwarding-and-whats-the-difference-between-ssh-local-and-remot
- https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument?DocumentKey=c52cedd7-84ed-4dad-92a6-13fc487da126&CommunityKey=1ecf5f55-9545-44d6-b0f4-4e4a7f5f5e68&tab=librarydocuments
- https://www.upswift.io/post/reverse-ssh-tunneling-from-start-to-end