Operating System - HP-UX
1834215 Members
2206 Online
110066 Solutions
New Discussion

List Users who access a file

 
Renjus
Advisor

List Users who access a file

How can I know the Users who access a file for last 30 days

please help me
9 REPLIES 9
Raj D.
Honored Contributor

Re: List Users who access a file

Lijin,

why do you need to know that.
Please provide more data in detail.

Btw, to see if a file aceess by user use:
# fuser filename
The pid will be listed.



Hth,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Suraj K Sankari
Honored Contributor

Re: List Users who access a file

Hi,
>>How can I know the Users who access a file for last 30 days

Its impossible task to know who access a file how many times.

"fuser" can tell the current status of that file who is using......

Suraj
singh sanjeev
Trusted Contributor

Re: List Users who access a file

modification of file can be to some extent can be check with history of user :

#grep -i .ssh_history*

But who access the files ..no idea.!!
Sanjeev Singh
Dennis Handly
Acclaimed Contributor

Re: List Users who access a file

If you need this level of detail you'll need to turn on auditing. And you may need massive amounts of disk space to keep this info. What HP-UX version are you using?
Emil Velez
Honored Contributor

Re: List Users who access a file

That information is not specifically kept by the OS unless you have auditing turned on.

at docs.hp.com there is a document on auditing. You can audit specific users or system calls. In order to do this you will need to audit system calls.

Just thought of another ides. You could use IDS9000. IDS 9000 is a intrusion detection software but it has kernel templates that allow you to watch access or creation of files. You would have to custimize the paramaters for the template for that specific file.

IDS9000 has its own documentation and is available for multiple HPUX releases.

Your question did not clarify whether this is a request for past access or future access. I hope thse suggestions help.

Taifur
Respected Contributor

Re: List Users who access a file

Hi,

To figure out, who performed any action, most of which may require root-permissions, you have to look at the information, stored in /etc/wtmp . You may access these with command "last" or, getting some additional information, by executing:
#cat /etc/wtmp
#tail -1000 > /etc/wtmp.txt
#vi /etc/wtmp.txt

http://docs.hp.com/en/5991-8678/ch06s03.html

Rgds//
Taifur
Dennis Handly
Acclaimed Contributor

Re: List Users who access a file

>Taifur: getting some additional information, by executing:

You probably mean:
tail -1000 /var/adm/wtmps > /etc/wtmp.txt

But this would have lots of binary data in it. So it is just easier to use last(1).
James R. Ferguson
Acclaimed Contributor

Re: List Users who access a file

Hi:

>Taifur: getting some additional information, by executing:

...instead of 'last()', a more parsable (and more information-rich) format is to do:

# /usr/sbin/acct/fwtmp -X < /var/adm/wtmps > /tmp/wtmps

Regards!

...JRF...

Renjus
Advisor

Re: List Users who access a file

Hi Thanks for all


Iam having HP RP5470 with
HP-UX unix B.11.11 U 9000/800 1126454616 unlimited-user license


We having Oracle 10g.