Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jan 2007 21:42:49 +0200
From:      Todor Dragnev <todor.dragnev@gmail.com>
To:        George.Vanev@gmail.com
Cc:        Pieter de Goeje <pieter@degoeje.nl>, freebsd-questions@freebsd.org
Subject:   Re: Execute script every time a specified user logs in (FreeBSD 6.1)
Message-ID:  <AED38E32-E397-469B-A1EB-C39CBC3A8FCF@gmail.com>
In-Reply-To: <6f4f57f60701170846m23276acdy37f1c15e26fb20f9@mail.gmail.com>
References:  <6f4f57f60701170249w39a5976bu24b42bd93c150165@mail.gmail.com> <200701171419.21936.pieter@degoeje.nl> <6f4f57f60701170846m23276acdy37f1c15e26fb20f9@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
You can attach script to auth.info;authpriv.info in syslog.conf and  
listen for login events...

man syslog.conf(5) - look for vertical bar(pipe) functionality


On Jan 17, 2007, at 18:46 , George Vanev wrote:

> On 1/17/07, Pieter de Goeje <pieter@degoeje.nl> wrote:
>>
>> On Wednesday 17 January 2007 11:49, George Vanev wrote:
>> > Every time user X (for example) logs in the system
>> > I want to be executed some script.
>> > The user must not have the permission to
>> > change this behavior.
>> > Also the script must be run as root.
>> > Something like crontab, but depending on logins, not time
>> >
>> > Any ideas?!
>> If this user logs in via SSH you can use the ForceCommand keyword in
>> sshd_config(5) to execute your script. The root part can be  
>> achieved with
>> sudo(8).
>>
>> Regards,
>> Pieter de Goeje
>>
>
> Thanks, nice idea. But it seams I can't use it.
> Let me be more specific:
> If user X logs in then I want to be run "/usr/bin/script -aq /path/ 
> user_X"
> The file user_X must be protected from modifying/deleting
>
> Could this be done?!
>
> -- 
> George Vanev
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions- 
> unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AED38E32-E397-469B-A1EB-C39CBC3A8FCF>