Howto run privileged commands on login/logout

Pieter de Goeje pieter at degoeje.nl
Sun Feb 7 01:40:39 UTC 2010


On Sunday 07 February 2010 01:55:02 Erik Norgaard wrote:
> I'm playing around with diskless operation. I'd like to be able to run
> privileged commands when a user logins or logs out:
>
> - on login, nfs mount the user's home directory (ok, not critical, I can
> mount /home)

This can be done using amd(8). Check out the example section in amd.conf(5).

> - on logout a system reboot to clean up any temporary files left from
> the session.

Not sure why you would want to reboot the entire system but simply 
doing "chmod +s /sbin/shutdown" should give all users access to the 
shutdown(8) command.

>
> Is this possible, without messing arround with sudo or adding users to
> wheel or operator groups?

--
Pieter de Goeje


More information about the freebsd-questions mailing list