From owner-freebsd-questions@FreeBSD.ORG Wed Jan 17 13:19:27 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 67BCB16A416 for ; Wed, 17 Jan 2007 13:19:27 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from smtp.utwente.nl (smtp2.utsp.utwente.nl [130.89.2.9]) by mx1.freebsd.org (Postfix) with ESMTP id CE51813C4BE for ; Wed, 17 Jan 2007 13:19:26 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from nox.student.utwente.nl (nox.student.utwente.nl [130.89.165.91]) by smtp.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id l0HDJMox013472; Wed, 17 Jan 2007 14:19:22 +0100 From: Pieter de Goeje To: freebsd-questions@freebsd.org, George.Vanev@gmail.com Date: Wed, 17 Jan 2007 14:19:21 +0100 User-Agent: KMail/1.9.5 References: <6f4f57f60701170249w39a5976bu24b42bd93c150165@mail.gmail.com> In-Reply-To: <6f4f57f60701170249w39a5976bu24b42bd93c150165@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701171419.21936.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: 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 13:19:27 -0000 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