LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 04-21-2008, 07:07 PM   #1
rusty_turkey
LQ Newbie
 
Registered: Oct 2005
Location: Queensland, Australia
Distribution: Solaris
Posts: 14

Rep: Reputation: 0
Question Any way to find who last edited a file?


This may be an impossible task, but being a bit of a noob, I have to ask.

Is there any way to find out which user last made any sort of changes to a file?

e.g. lets say that a config file is changed, and it doesn't work any more - and of course, when you ask around "nobody touched that file". Is there any way to find out who last changed it? or is there absolutely no record of that sort?
(using multiple flavours of Solaris, in case that makes a difference)
 
Old 04-21-2008, 07:51 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
How is "that file" being accessed using varied flavours of Solaris?


Cheers,
Tink
 
Old 04-21-2008, 07:57 PM   #3
rusty_turkey
LQ Newbie
 
Registered: Oct 2005
Location: Queensland, Australia
Distribution: Solaris
Posts: 14

Original Poster
Rep: Reputation: 0
Just in the bash shell - via putty sessions.
 
Old 04-21-2008, 08:06 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <SOLARIS> and has been moved accordingly to help your thread/question get the exposure it deserves.


I seem to recall that Solaris has some sort of auditing features, but if people happen
to log in via ssh as the same user you'd need to try and match their IPs from the output
of last to the time the file was last modified. Of course that's not fool-proof since
several could have been logged in at the same time.

Ideally you'd want to avoid that kind of stuff happening by using CVS (or similar)
and have configuration changes polled via daemon or so. (Or use cfengine or other
tools to achieve the desired effect).



Cheers,
Tink
 
Old 04-21-2008, 10:10 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by Tinkster View Post
CVS (or similar)
Solaris has a built in versioning software called sccs

For more information
Code:
man sccs
 
Old 04-21-2008, 10:13 PM   #6
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
If you have a bunch of people running around with a root password and su access, your pretty boned.

If you want to prevent this sort of thing in the future, you need to learn how to properly set up, use, and write secure rules for sudo. Not only does it allow you to allow people to only run the commands they need, and possibly only edit the files they need to edit, but it allows you to audit who did what if you have a tight setup with no evil shell escapes, no sudo bash, and no other loopholes.
 
Old 04-22-2008, 01:10 AM   #7
rusty_turkey
LQ Newbie
 
Registered: Oct 2005
Location: Queensland, Australia
Distribution: Solaris
Posts: 14

Original Poster
Rep: Reputation: 0
Generally everyone here uses their own user names unless they need root access.

It's more of a general question of:
"is there a simple way (without using cvs, etc) to see which user/login last made changes to any arbitrary file?"

I think I have the answer to my question from the above posts anyway. It seems that you either use a versioning system or some kind of 'big brother' auditing daemon...
 
Old 04-22-2008, 03:40 AM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
The simple way to solve this problem (as has been hinted above) is to ensure that the wrong people cannot change files that they are not supposed to.

If you have to have multiple root users (and they should really be competent; maybe that isn't an option open to you!), I think I would ensure that there is no root login; everyone would login as their own user name and su to root only if necessary. You could log that and correlate that to any bad file chages.
 
Old 04-22-2008, 04:19 AM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by rusty_turkey View Post
Generally everyone here uses their own user names unless they need root access.

It's more of a general question of:
"is there a simple way (without using cvs, etc) to see which user/login last made changes to any arbitrary file?"
While a nice little witch-hunt within the ranks can be quite
refreshing the objective is (should be?) to get the file back
into a working state. Finding who screwed it up won't necessarily
help with that. Neither will an audit daemon... a version
control system will - plus (as a bonus) you'll see WHO made
the change that caused problems on top of that.



Cheers,
Tink
 
Old 04-22-2008, 03:58 PM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
For the witch hunting side, BSM auditing is a Solaris tool that can help:
http://docs.sun.com/app/docs/doc/816...28?l=en&a=view
 
Old 04-23-2008, 02:11 AM   #11
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by Tinkster View Post
While a nice little witch-hunt within the ranks can be quite
refreshing the objective is (should be?) to get the file back
into a working state. Finding who screwed it up won't necessarily
help with that. Neither will an audit daemon... a version
control system will - plus (as a bonus) you'll see WHO made
the change that caused problems on top of that.



Cheers,
Tink
But if you know who screwed up, you have a chance of finding out what they were doing and why. You can also stop them from doing bad things in future, which might be training or something else.
 
Old 04-23-2008, 01:19 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by salasi View Post
But if you know who screwed up, you have a chance of finding out what they were doing and why. You can also stop them from doing bad things in future, which might be training or something else.
This doesn't really contradict my statement all that much.
It's all a matter of training (and processes), and a version
control system has clear advantages. As you said "you have
a chance". If that change was done 6 months ago, and it only
cropped up now because the machine/service only just got bounced
you're pretty much out of luck, and again, knowing who did it
won't help you at all. It's about a sensible process as far
as I am concerned.


Cheers,
Tink
 
Old 04-24-2008, 11:17 AM   #13
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
I usually walk around the office saying:

"what bloody idiot screwed up that file?"

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I rebuild an RPM with an edited .spec file? koobi Linux - Server 3 12-04-2007 11:17 AM
Is there a way to find recently created/edited files without using find? BrianK Linux - General 2 10-15-2007 09:41 PM
php: file last edited airswit Programming 2 12-19-2005 02:57 AM
Open vi at top of file rather than last edited line... davee Linux - General 2 04-22-2005 06:34 AM
Find File broken, need search utility, where does WineX install, KDE file roller? Ohmn Mandriva 6 07-05-2004 10:34 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration