How to Find Out When a User is Created in Linux

This is a pretty standard interview question. Here is the real answer. There are some things you can do to get the creation date but all of them depend on a specific set of circumstances and/or software to determine that date and time.
For example, if created and not touched since the user creation you can use the .bash_logout file to determine the date.
As root run
ls -l /home/<username>/.bash_logout

If the user was created recently and your log files have not been rotated out (usually about 4 weeks) you can check /var/log/messages for ‘useradd’. The useradd line will include the date and time.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s