How to mail the name of the user that logged off?

Mikkel L. Ellertson mikkel at infinity-ltd.com
Tue Sep 25 18:29:43 UTC 2007


Tony Nelson wrote:
> At 2:25 AM -0600 9/25/07, Frank Cox wrote:
>> On Tue, 25 Sep 2007 01:19:51 -0700
>> Brian Mury <brianmury at alumni.uvic.ca> wrote:
>>
>>> That would work, so long as the user doesn't modify ~/.bash_logout.
>> chown root.root .bash_logout
>> chmod 444 .bash_logout
>> cp .bash_logout /etc/skel
>>
>> You're off to the races.
> 
> The user can just rm .bash_logout and make a new one.  Try it.
> 
> I suspect a working answer might involve PAM, session, and pam_exec.

Dumb question - can you set PAM to run something when the user logs
out? Everything I have seen using PAM is when you try to to do
something, and PAM uses rules to see if you can do it. But the
application has to ask for authentication. I do not see what would
be calling PAM. logout is a Bash built-in command - I believe it is
the same for other shells. The same thing for exit.

For csh, you can put commands in /etc/csh.logout. I do not see the
equivalent system-wide script for bash.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070925/2cebe557/attachment-0001.sig>


More information about the fedora-list mailing list