3.6. Testing

3.6.1. Setting up Netfilter rules before 2.6.14

We will test the setup by connecting from the local host ssh server. For this we need to add filtering rules to ask for authentication:

iptables -A OUTPUT -s 192.168.75.0/24 -p tcp --dport 22 -m state --state NEW --syn -j QUEUE
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
[1]

3.6.2. Setting up Netfilter rules from 2.6.14

We will test the setup by connecting from the local host ssh server. For this we need to add filtering rules to ask for authentication:

iptables -A OUTPUT -s 192.168.75.0/24 -p tcp --dport 22 -m state --state NEW --syn -j NFQUEUE
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
[2]

3.6.3. Testing the authentication system

First, the daemons need to be started. We start nuauth in a terminal

nuauth -vvvvvvvvv
then we start
nufw -vvvvvvvvv
in another terminal.

Next, we can try to connect a user. Under Linux it can be done with:

nutcpc -d -H [NUAUTH IP]
enter name and password of a system user.

At nuauth level, we should see something like:

user bill@nufw uses OS Linux, 3.0.10, #1 Tue Oct 19 23:51:32 CEST 2008
If your PAM setup is based on shadow file, you will not be able to authenticate a user different from the one running nuauth. On this kind of setup, nuauth needs to be run as root to authenticate other users. [3]

3.6.4. Initial tests and debug process

A ssh connection from the computer to start the authentication process:

Notes

[1]

Only SYN packets are sent to QUEUE. This is not enough to do advanced user activities logging, but enough for trafic authentication.

[2]

Only SYN packets are sent to NFQUEUE. This is enough to do advanced user activities logging, because events on the connections will be automatically sent to nufw by Netfilter. This requires, in particular, that the CONFIG_IP_NF_CONNTRACK_EVENTS kernel option be set.

[3]

Never launch nutcpc against 'localhost' or '127.0.0.1', even if nuauth is on the same computer. Packets sent to nuauth by the firewall will hardly have the address of the loopback but rather have a source address which is one of the network interface.