Solved

log traffic

Posted on 2004-07-30
12
295 Views
Last Modified: 2010-08-05
i need to log all traffic that is being created by a specific uid
the box have multiple nic's if it matters.
the uid dosent belong to a real system user with shell but will show up like #405 in ps where 405 is a uid in a chrooted /ftpd/etc/passwd
where do i start?
i need a full explenation since i dont really have time to read everything on the subject.
0
Comment
Question by:loadet
  • 6
  • 5
12 Comments
 
LVL 14

Expert Comment

by:pablouruguay
ID: 11681186
you need to log "what service" ??

ftp ?
httpd?
 
0
 

Author Comment

by:loadet
ID: 11681209
does it matter?
i need to log all traffic from that uid
but its a ftpd .. not the standard ftpd service.
and i did try something like iptables -A OUTPUT -m owner --uid-owner 405
but it just gets me a iptables: Invalid argument
0
 
LVL 6

Expert Comment

by:de2Zotjes
ID: 11681557
check if you have the owner module for ip tables. It should be in the modules subtree on your system ( /lib/modules/`uname -r`/kernel/net/ipv4/netfilter )

You are probably missing the module.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:loadet
ID: 11681577
i have ipt_owner.ko

would that be it?
0
 
LVL 6

Expert Comment

by:de2Zotjes
ID: 11694635
That is the module your need. load it using:

modprobe ipt_owner

after that try your command again:

iptables -A OUTPUT -m owner --uid-owner 405 -j LOG

Should do the trick (just checked on my own machine)

Good Luck
0
 

Author Comment

by:loadet
ID: 11699641
yeah i thought that was the problem too but it was already loaded
FATAL: Module ipt_owner already in kernel.
0
 
LVL 6

Expert Comment

by:de2Zotjes
ID: 11701050
That fatal is not fatal :-)

Does it accept the iptables command without complaining?
0
 

Author Comment

by:loadet
ID: 11701119
no it gives me a
iptables: Invalid argument
im running
iptables v1.2.6a
kernel 2.6.4

lsmod gives me

ipt_owner               4480  0
iptable_filter          3840  1
ip_tables              17168  2 ipt_owner,iptable_filter

so i dont really understand it
0
 
LVL 6

Expert Comment

by:de2Zotjes
ID: 11708094
I did 2 things:

checked my version of iptables and kernel: iptables 1.2.9 and kernel 2.6.7

searched the sources of iptables and the kernel ipfilter modules for the "Invalid argument": it's not there. So whatever is giving this error, it is not in iptables or the kernel modules.

Could you please check what iptables you are executing? (try: which iptables)
0
 

Author Comment

by:loadet
ID: 11712313
start:/home/loadet# which iptables
/sbin/iptables
0
 
LVL 6

Accepted Solution

by:
de2Zotjes earned 250 total points
ID: 11713852
I am at a loss now. I can only sussgest to upgrade your version of the iptables tools and to check again that you get the command line correctly:

/sbin/iptables -A OUTPUT -m owner --uid-owner <numeric> -j LOG
0
 

Author Comment

by:loadet
ID: 11716464
ok i will try that, thanks for trying.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question