From owner-freebsd-questions@FreeBSD.ORG Mon Oct 9 08:46:04 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E1F216A416 for ; Mon, 9 Oct 2006 08:46:04 +0000 (UTC) (envelope-from mail@lobraun.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id D562443D46 for ; Mon, 9 Oct 2006 08:46:02 +0000 (GMT) (envelope-from mail@lobraun.de) Received: from [84.160.187.153] (helo=[192.168.0.4]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis), id 0MKxQS-1GWqlj3U4j-0005lv; Mon, 09 Oct 2006 10:45:52 +0200 From: Lothar Braun To: freebsd-questions@freebsd.org Date: Mon, 9 Oct 2006 10:45:48 +0200 User-Agent: KMail/1.9.4 References: <38221ea10610090024l5f7aebdfp6c551e3955b9cc10@mail.gmail.com> <200610090941.41014.mail@lobraun.de> <20061009080338.GA2184@rebelion.Sisis.de> In-Reply-To: <20061009080338.GA2184@rebelion.Sisis.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610091045.51211.mail@lobraun.de> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:104f95452e150713f597d156114ee5ee Cc: Matthias Apitz , James Corteciano Subject: Re: How to change all /bin/bash at /etc/passwd to /sbin/nologin? 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: Mon, 09 Oct 2006 08:46:04 -0000 On Monday 09 October 2006 10:03, Matthias Apitz wrote: > > sed 's!/bin/bash$!/sbin/nologin!' /etc/passwd > /etc/passwd > > DONT DO THAT this way. The result would be that your actual > shell truncates the file '/etc/passwd' to zero length and > then launches the 'sed'. Damn. I just built the regexp but didn't check what the command does before i sent it to the list. Sorry for that. I hope nobody killed his pw-file because of my advice :/ -- Lothar