Operating System - HP-UX
1837893 Members
3499 Online
110122 Solutions
New Discussion

creation date of the login ID

 
nash11
Frequent Advisor

creation date of the login ID

how do I know the exact creation date of the unix login ID ? thx
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: creation date of the login ID

You can't. That datum is not stored by the OS. This applies to both traditional and Trusted systems. Man 4 prpwd for details (but you won't find what you are looking for). You MIGHT be able to infer that time from timestamps in the user's home directory but even then UNIX has no concept of the creation time of a file much less of a user account.

Any such timestamps (along with deactivations/removals) must be custom done.
If it ain't broke, I can fix that.
spex
Honored Contributor

Re: creation date of the login ID

nash11,

As Clay said, HP-UX does not keep a creation timestamp for a file/user. However, a file's last modification timestamp will function as a creation timestamp as long as the file (actually its inode) has not been modified since it was created. With this in mind, you can try to infer when the user was created from the "dot" files in his/her home directory:

# cd ~user
# ls -ldrt .*

...or by looking at the home directory itself:

# ls -ld ~user

PCS
DCE
Honored Contributor

Re: creation date of the login ID


As the others have said, HP-UX does not track creation date.

About the only way is to cat the date to a file when you create the id.

you can either do this manually, or add a line to your script for id creation.

If this is important info to you, then make sure you write the info to a secure area, and make the file is read only.
Raj D.
Honored Contributor

Re: creation date of the login ID

Nash ,
You can check it by using this command:

# cd ~username
# ls -l .profile

Check the date of the .profile and it will tell which date the user was created. This is true if the file was not modified after that.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "