Get username of last user to modify a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Get username of last user to modify a file
# 1  
Old 04-28-2011
Get username of last user to modify a file

Possible to get this? Thanks
# 2  
Old 04-28-2011
The question is not clear enough. how do you define the last user?
# 3  
Old 04-29-2011
I believe the OP meant to ask if there is a way to tell who modified a file the last time it was modified.

Example:


File is created by user1 and owned by user1 since he created it.
Now user1 has editied many times but so has user2 and user3.

A change was made but I want to ask the person that made the last change what they changed or why.

How can I tell if the change was made by user2 or user3 since ls only shows who the file is owned by?

Simple answer: You can't with standard posix file stats.





There is a more complex answer that might give you what you need though.

Using a file integrity monitor like tripwire, osiris, or auditd can give you that info if it is installed and set to monitor that file.

If not then all is not lost, if you have admin privs (root) you can look at each users history if they have not already removed that entry in their history files.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Modify the max username length

Hey Any one... Do u know any way I can modify the max username length in unix? I guess it is 32/64 characters by default. Suppose I want to increase it to 128. i hav tried /etc/skel but no use... How can I do that? (2 Replies)
Discussion started by: MayureshRisbud
2 Replies

2. UNIX for Dummies Questions & Answers

How to get the username if I know only the user's UID?

Hi, I know the user's UID, but I need to know the user's username which has this UID. How can I do it?? Any ideas? Thanks! (7 Replies)
Discussion started by: rodrigoroma
7 Replies

3. UNIX for Dummies Questions & Answers

Sending mail as another user (username masquerading)

I have sendmail as the smtp server. I want that all mails sent from user1 actually appears to come from user2(also should be reflected in mail header). How can i accomplish the task by tweaking sendmail or are there any other means to do so? (4 Replies)
Discussion started by: proactiveaditya
4 Replies

4. Solaris

Need help with script when trying to modify user

The script get a csv file with 2 colls for example: 123456,UNIX 963852,Microsoft the script supose to put the number in the Description of the user in this case UNIX or Microsoft the error i get is does not exist.OR: UNIX does not exist.OR: Microsoft but the users exist so i do not... (7 Replies)
Discussion started by: shatztal
7 Replies

5. Shell Programming and Scripting

Need to modify a file of different username through script.

Hi ! All I want to write a script where, it will open a new shell with a username / pwd and modify a file of same username and exit. example: 1. UserA 2. UserB- FileB ScriptA -> su UserB -> Modify FileB -> Exit ScriptA Can somebody give me a direction , on how to... (2 Replies)
Discussion started by: dashok.83
2 Replies

6. Shell Programming and Scripting

Find username of user running the script

Hello All, If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... $val=$ENV{'HTTP_COOKIE'}; $name... (1 Reply)
Discussion started by: garric
1 Replies

7. UNIX for Dummies Questions & Answers

Modify user home dir

I created a new user and assigned a certain home dir to tis user. I've noticed that this home dir (/export/home/test) is already assigned to other users. I really want to create a dedicated home dir for the new user. Can anyone tell me how I can modify this user with a new homedir? Thx for... (4 Replies)
Discussion started by: kris_devis
4 Replies

8. UNIX for Dummies Questions & Answers

AIX:creating user with username more than 8 chars

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (0 Replies)
Discussion started by: anuafs84
0 Replies

9. UNIX for Dummies Questions & Answers

Modify Root user account ?

How can I modify Root account ? (I want to change the default shell after logging in) Thanks (3 Replies)
Discussion started by: hitlermom
3 Replies
Login or Register to Ask a Question