From owner-freebsd-questions@FreeBSD.ORG Wed Jan 17 16:46:48 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 115DD16A47E for ; Wed, 17 Jan 2007 16:46:48 +0000 (UTC) (envelope-from george.vanev@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by mx1.freebsd.org (Postfix) with ESMTP id C2BD513C45B for ; Wed, 17 Jan 2007 16:46:47 +0000 (UTC) (envelope-from george.vanev@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so1257259ana for ; Wed, 17 Jan 2007 08:46:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=GpfX0+lpOCfFCk3UTjM0FWcUUwb14V/tj4CmKbh6WSXrjCHNPIEZv41nYADX6x6XeVMJgzVKsYDPkYOu4SDeBGCDSZCo3ih3PWTnhPiHCo20wHNZyzKXkhRIroMOHVgK5tZWNxbAg8lIOWvsz/UimqliFzdwUDnmhPXYOUgjLgc= Received: by 10.100.9.19 with SMTP id 19mr3631825ani.1169052407168; Wed, 17 Jan 2007 08:46:47 -0800 (PST) Received: by 10.70.12.14 with HTTP; Wed, 17 Jan 2007 08:46:46 -0800 (PST) Message-ID: <6f4f57f60701170846m23276acdy37f1c15e26fb20f9@mail.gmail.com> Date: Wed, 17 Jan 2007 18:46:46 +0200 From: "George Vanev" To: "Pieter de Goeje" In-Reply-To: <200701171419.21936.pieter@degoeje.nl> MIME-Version: 1.0 References: <6f4f57f60701170249w39a5976bu24b42bd93c150165@mail.gmail.com> <200701171419.21936.pieter@degoeje.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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 Reply-To: George.Vanev@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2007 16:46:48 -0000 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