Guest User

Untitled

a guest
Aug 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. ssh port forwarding (tunneling) in linux
  2. laptop -> gateway -> remote_server_1
  3.  
  4. laptop -> remote_server_2
  5.  
  6. mylaptop$ ssh -L 3001:localhost:3000 server_2
  7. server_2$ netcat -l 3000
  8.  
  9. ssh -t -t -L 3003:server_1:22 gateway
  10.  
  11. ssh -R 3002:localhost:3001 -p3003 localhost
  12. echo "bar" | nc localhost 3002`
  13.  
  14. mylaptop$ ssh -L 3001:localhost:3000 server_2
  15. server_2$ netcat -l 3000
  16.  
  17. mylaptop$ ssh -R 3002:localhost:3001 server_1
  18. server_1$ echo "foo" | netcat localhost 3002
Add Comment
Please, Sign In to add comment