From owner-freebsd-questions@FreeBSD.ORG Wed Jan 17 20:07:19 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B249816A412 for ; Wed, 17 Jan 2007 20:07:19 +0000 (UTC) (envelope-from todor.dragnev@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by mx1.freebsd.org (Postfix) with ESMTP id 483CC13C457 for ; Wed, 17 Jan 2007 20:07:18 +0000 (UTC) (envelope-from todor.dragnev@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so1911416uge for ; Wed, 17 Jan 2007 12:07:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=SFOXOBv1LWiY6RRy2JlX8OnpUFwKnFeyR0hRMWJ0/WVLM7YjEFyfK3NxUymNG6G0i+Pv8OcG41Ll3wvJKRWhcR5OMF/dn7XK+gzu1YvCa3TX8zueIUn9GoAb4oduY22ANy42vUc/cWE1pFPTWrPPntDnE9lAJWehseaLO5kwzC0= Received: by 10.66.221.6 with SMTP id t6mr10050112ugg.1169062997862; Wed, 17 Jan 2007 11:43:17 -0800 (PST) Received: from ?192.168.1.2? ( [90.154.218.251]) by mx.google.com with ESMTP id k28sm10881494ugd.2007.01.17.11.43.17; Wed, 17 Jan 2007 11:43:17 -0800 (PST) In-Reply-To: <6f4f57f60701170846m23276acdy37f1c15e26fb20f9@mail.gmail.com> References: <6f4f57f60701170249w39a5976bu24b42bd93c150165@mail.gmail.com> <200701171419.21936.pieter@degoeje.nl> <6f4f57f60701170846m23276acdy37f1c15e26fb20f9@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Todor Dragnev Date: Wed, 17 Jan 2007 21:42:49 +0200 To: George.Vanev@gmail.com X-Mailer: Apple Mail (2.752.3) Cc: Pieter de Goeje , freebsd-questions@freebsd.org Subject: Re: Execute script every time a specified user logs in (FreeBSD 6.1) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2007 20:07:19 -0000 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 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"