Options:
-R - connections to remote server will be tunneled
-2 - Use ssh version 2 (more secure)
-NX - Don't execute any remote commands, just create tunnel
-f - Background process
-C - use compression
# ssh -R 1234:local-server:80 username@remote-serverWith the above command anyone trying to go to remote-server:1234 will be redirected to local-server:80 as seen from the machine initiating the ssh connection.
Autossh
Autossh can be used to maintain a ssh tunnel, bringing it back up automatically if it fails.
Options as above with addition of:
-M - monitoring port to use
# autossh -2 -fN -M 2000 -R1234:localhost:80 user@remote-server
No comments:
Post a Comment