1833784 Members
2825 Online
110063 Solutions
New Discussion

user info

 
SOLVED
Go to solution
John McDen
Regular Advisor

user info

Is ther way to know when was a user account created on the system??
New to HP
15 REPLIES 15
Sridhar Bhaskarla
Honored Contributor
Solution

Re: user info

General answer is no. If you didn't recycle samlog and if the user was added through SAM, you can use /usr/sam/bin/samlog_viewer to find previous logs.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
hpuxrox
Respected Contributor

Re: user info

Other than the date and time stamps on their home directorys( Which can be changes at a later time. ), I can't think of one single way.

Maybe go look at the last log or check backups to get a round about time.

-Yates
S.K. Chan
Honored Contributor

Re: user info

"First created" .. I would say no, otherwise we would not include this info in our GECOS field.

"First logon" .. possible by tracing utmp/wtmp file entries.
Uday_S_Ankolekar
Honored Contributor

Re: user info

Hello,

I don't think you can do this. But if you are sure about users .profile files from home directory were not modified then time stamp would give you general idea when it was created.

But this would be just guessing.

-USA..
Good Luck..
Sukant Naik
Trusted Contributor

Re: user info

Hi John,

Its very dificult to say when the user has been created.

But there is a command called 'last' which can give you when the user had last logged in.

# last sukant
sukant pts/tb Fri Apr 26 21:00 - 21:00 (00:00)
sukant pts/tb Fri Apr 26 20:59 - 21:00 (00:00)
sukant pts/tb Fri Apr 26 20:59 - 20:59 (00:00)
sukant pts/tb Wed Apr 24 15:08 - 15:09 (00:00)
sukant pts/tb Wed Apr 24 12:25 - 12:25 (00:00)

wtmp begins Mon Apr 22 14:04

Just my two cents.
-Sukant
Who dares he wins
Peter Kloetgen
Esteemed Contributor

Re: user info

Hi John,

no general way, but you can check out this very easy with the following command:

cat /etc/passwd | wc -l

output is the number of lines in /etc/passwd, for each user account one line. When you do this command next time, and the number increased, new accounts where configured.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Steven Sim Kok Leong
Honored Contributor

Re: user info

Hi,

If this is a trusted system, check the timestamp of the TCB profile e.g.

# ll /tcb/files/auth/s/steven

While a home directory is optional during account creation, the created TCB profile is always created during account creation.

Hope this helps. Regards.

Steven Sim Kok Leong
Thomas Schler_1
Trusted Contributor

Re: user info

Hi John, Steven,

Steven:
Unfortunately, you're not right. The timestamp of the TCB profile always is changed when you login. That's because
of the fields 'u_succhg' and 'u_unsuclog' that are
updated at each login (successful or unsuccessful).

Even using 'll -c' you obviously get not the time of the inode creation.

So in my opinion, too, there's no way to really get the
time of account creation (beside the docs of the other
authors).
no users -- no problems
Steven Sim Kok Leong
Honored Contributor

Re: user info

Hi Thomas,

Yes, you are right. Thanks for pointing out the mistake.

Regards.

Steven Sim Kok Leong
Pete Randall
Outstanding Contributor

Re: user info

John,

How about putting a file (let's call it $home/.000file) in their $HOME as part of the create process and make it non-writable, non readable, invisible (000)? If you use sam to add users, you can customize it to add this step. Then you could always check the date on $home/.000file.

Pete

Pete

Re: user info

Good idea Pete, but any file in a users home directory isn't going to be un-touchable by that user - they own the directory itself, and so have permission to remove files in that directory.

They can't read the file, or write to it, but they can delete it...

HTH

Duncan

I am an HPE Employee
Accept or Kudo
John Carr_2
Honored Contributor

Re: user info

Hi

I reckon the closest is the wtmp/utmp files providing they have not been purged.

For the future I would create a file using the following command

touch /etc/skel/.creation

now all new user accounts creted will have a file in the home directory with the cretaion date.
Pete Randall
Outstanding Contributor

Re: user info

Good point Duncan. However, if root owned it . . .

Pete

Pete
Pete Randall
Outstanding Contributor

Re: user info

Well slap me silly, they can still remove it !! Thanks, Duncan, for teaching me something I should have known.

I still think that this approach will work 99% of the time. Most users wouldn't even see the file let alone remove it.

Oh well.
Pete

Pete
Donny Jekels
Respected Contributor

Re: user info

look at the logins command.

it provides everything you need.
"Vision, is the art of seeing the invisible"