SSH tunnels can provide secure connections through insecure or untrusted networks and may also be used to securely route through firewalls.
About This Guide
This guide began as a personal document to help me learn and remember how SSH tunnels work and has been several years incubating. If you find errors or think of additional examples that you believe would be helpful, I’d be delighted to know about them.
Terminology
Throughout this guide we use “SSH” to refer to the SSH protocol or the world of SSH things and use ssh
to refer to the ssh(1)
program itself. “We use ssh
and sshd
to make SSH connections.” The examples in this tutorial are based on OpenSSH 0.9.8 and later.
Here are some notes I keep for myself when I play with iptables
(I don’t use it often enough to remember how it works):
List all rules
# iptables -L
See the rules and their numbers
# service iptables status
Delete a rule
# iptables -D CHAIN NUM
E.g.:
# iptables -D INPUT 12
Add a new rule at the bottom of the chain
# iptables -A INPUT -i eth0 -p tcp --dport 8888 -j ACCEPT
Insert a new rule in a particular place
This inserts a rule in position 6; the rule that was formerly in 6th position will be bumped down (and all rules below it):