Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently we're running OES 2.0.1 / SLES 10.2 and I'm trying to figure out how to track when users log in and out of the system. I've been googling around for a couple hours and all I can find is that Novell discontinued an addin that would do this back in '09.

So the question: How can I track user login/logout times in OES 2 / SUSE 10.2?

EDIT: Sorry, I need to be able to track logins via the Novell Client/NDS, these users don't actually have linux logins associated with them.

share|improve this question
up vote 1 down vote accepted

I'm not sure how to track logouts, but we track login times on our Suse servers by adding this to /etc/profile.local:

# Set current date/time
CURRTIME=`date +%Y-%m-%d-%T`

echo $CURRTIME >> /usr/local/logins/$USER

So if you logged in as user ernie for example, it will create a file called /usr/local/logins/ernie that contains a line for each login time for that user.

/etc/profile.local is used to set environment variables, etc... whenever a user logs in, so you can put code in there that you want fired each time a user logs in.

You can tweak $CURRTIME to get the date format you need. $USER is a default environment variable with the user's name. You'll need to create the /usr/local/logins directory or whatever directory you want to dump login "tracking files" to.

share|improve this answer
This does work for linux logins, sorry I wasnt specific in my initial question. – ErnieTheGeek Sep 6 '11 at 14:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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