shell script for monitoring users activities

hi I need a shell script which runs perpetually in background and monitors different aspects of different users on different files and their usages

for example say there r 3 users

so i want when they log in i.e. their log in time and their file access, modify and change log of each file of a specific directory. I also want from which system they r from i.e. their IP address [when u log from a remote machine]

plz help...................

last will supply you with the login time, protocol and remote location...so you can focus on the means of the file monitoring...

Hi,

Use script command to log shell commands.
e.g.
script -a <path_of_log_file>

thanks,
Shah

Some OSes have auditing subsystems that offer such things. There are also IDSes (Intrusion Detection System) like tripwire etc. that can monitor similar things.