Sometimes, the login process for the users takes a lot of time since there are many things running during the login, like home directory auto mount.

We want to measure how much time it takes for each users's login. We wish to measure the time between the user enters the username&password and get the command prompt or Desktop. All the workstations are Linux Centos and logins can be over console or ssh.

I searched the web but couldn't find something valuable.

I would appreciate any hint or help.


1 Answer 1


You've not told what type of session the users are logging into.

The authentication and subsequent interaction occur in seperate processes. So you would need to capture the timestamps of these two events and compare them to get the elapsed time. They will occur under different uids - so its probably easier to use syslog to store the timestamps.

Authentication on a Linux system for ssh, console tty and XWindow system are all handled by PAM (along with other authentications) so I would write a custom PAM authentication module to capture this timestamp. Note that this should be configured as "required".

For a shell login, the interactive time could be captured at the relevant point in the .profile.

For XWindow logins, its a bit more tricky. There is typically a chain of bootstraps - with the last one being specific to the desktop environment, but the last entry in the XDG autostart list should be reasonably close.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.