CS183 Lab 10: Firewall and Advanced ssh usage

Goal:
In this lab, you will learn how to setup a firewall using iptables and a couple of advanced ssh usages.

Details:
CentOS Linux distribution comes with the iptables which is enabled by default. In previous several labs, you have to turn iptables off in order for those labs to work. In this lab, you will leave your iptables on (turn it on if not already), and make sure that your DNS server, web server and mail server are still working by adding extra rules into the iptables.

Every time when ssh'ing to a machine, a password needs to be entered. It could be troublesome sometime. This problem can be mitigated by using ssh-agent and ssh-add. Additionally, when ssh'ing to a machine with X11 Forwarding enabled, one has to use -X command line option. By creating a local ssh configuration file with X11 Forwarding option enabled, -X option is no longer needed.

iptables

Extra Credits (10%): Getting NFS and NIS to work with iptables is a bit tricky. Google "NFS iptables" and "NIS iptables", and get NFS and NIS to work with iptables.

Advanced ssh usage

Questions

  1. Show the result before and after adding the iptables rule to make DNS server to work.
  2. Show the result before and after adding the iptables rule to make web server to work.
  3. Show the result before and after adding the iptables rule to make mail server to work.
  4. Show that you do not need to type in any password when ssh'ing to a CS machine.
  5. Show that you can do X11 Forwarding without the -X option.

Scoring


Notes & Tips: