The context is I have my music on a single fanless PC that I would like to control through TightVNC on my main machine. To be absolutely anal about this, I would like to allow TCP port 5900 connections initiated from the main machine on this connection (a USB ethernet dongle) and nothing else at all.

What is the best way to set that up?

ip addr says:

4: enx0050b623f890: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

link/ether 00:50:b6:23:f8:90 brd ff:ff:ff:ff:ff:ff

inet brd scope global enx0050b623f890
   valid_lft forever preferred_lft forever

Remote machine is on

Thanks in advance!

1 Answer 1

# Dont lock yourself out. Allow SSH access to this server
iptables -I INPUT -p tcp -s --dport 22 -j ACCEPT
# Then allow VNC
iptables -I INPUT -p tcp -s --dport 5900 -j ACCEPT
# And finally block anything else
iptables -A INPUT -p tcp ! -s -j DROP

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .