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

I'm looking for an easy way to configure my server, so that whenever a user logs into it, I get an email about it.

Any pointers around how to get this working?

share|improve this question

Somebody has already built a notification module for PAM. I would look into downloading that and entering an appropriate configuration line in your related /etc/pam.d/ files.

If your users are restricted in what shells they select and they all process /etc/profile (bash does), you can write a script into that.

share|improve this answer

If your default shell is bash, you can add a sendmail entry to every .bashrc file to notify yourself of user logins.

I am sorry if it does not work that way. I am noob and trying to help you here.

share|improve this answer
Things that may make that an issue: chsh and the ability of a user to edit their own .bashrc. – Jeff Ferland Mar 31 '12 at 19:13

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.