Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

If I do (in rhel5):

useradd -m -e 2009-07-03 -c "Temp Account" tempuser

Will this account expire at the end of 2009-07-03 or at the beginning?

What if the user is still logged in? Is it kicked out?

Thanx for the great site!

share|improve this question
this was what i was afraid of... now im wondering how to deal with temporary accounts to allow the user to operate accounts per example only for a week... – criss Jul 3 '09 at 14:31
As long as you kill any open sessions a user may have that's probably enough. – LapTop006 Jul 3 '09 at 14:41
up vote 2 down vote accepted
  1. Account will expire at the end of 2009-07-03.
  2. Logged in user won't be kicked out. He won't be able to log in after he logout.

UPD: You can set TMOUT variable in ~/.bash_profile:

export TMOUT=3600

This will logout user if he is idle for an hour.

share|improve this answer
Just remember that the user can always change their own environment variables. – LapTop006 Jul 3 '09 at 14:41
You are right. My solution works only if you want not to forget about opened shell. – lexsys Jul 3 '09 at 14:58

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.