From owner-freebsd-questions@FreeBSD.ORG Thu Feb 28 13:07:50 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5987106566B for ; Thu, 28 Feb 2008 13:07:50 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from mail.irbisnet.ru (mail.irbisnet.ru [IPv6:2001:470:1f09:aa:203:baff:fe18:f4c1]) by mx1.freebsd.org (Postfix) with ESMTP id B66D78FC13 for ; Thu, 28 Feb 2008 13:07:44 +0000 (UTC) (envelope-from yuri.pankov@gmail.com) Received: from mail.irbisnet.ru (yuri@mail.irbisnet.ru [IPv6:::1]) by mail.irbisnet.ru (8.14.2/8.14.2) with ESMTP id m1SD7hnG000598; Thu, 28 Feb 2008 16:07:43 +0300 (MSK) (envelope-from yuri.pankov@gmail.com) Received: (from yuri@localhost) by mail.irbisnet.ru (8.14.2/8.14.2/Submit) id m1SD7hwv000597; Thu, 28 Feb 2008 16:07:43 +0300 (MSK) (envelope-from yuri.pankov@gmail.com) X-Authentication-Warning: mail.irbisnet.ru: yuri set sender to yuri.pankov@gmail.com using -f Date: Thu, 28 Feb 2008 16:07:42 +0300 From: Yuri Pankov To: Girish Venkatachalam Message-ID: <20080228130742.GF92245@mail.irbisnet.ru> References: <20080228123052.GA976@saraswathy.madambakam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080228123052.GA976@saraswathy.madambakam.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-questions@freebsd.org Subject: Re: Making .bash_history non writeable by user? 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: Thu, 28 Feb 2008 13:07:50 -0000 On Thu, Feb 28, 2008 at 06:00:52PM +0530, Girish Venkatachalam wrote: > > Hello friends, > > My friend wants the user commands history file ~/.bash_history to be non > writeable by user. He feels that the user should not able to erase the commands > entered by him. > > A reasonable requirement. > > In case the ~/.bash_history file can also be written to > another location that the root alone can access then perhaps we can > solve this problem. > > But AFAIK bash runs as the user process. How can you make the file > readable and writeable by root alone? In that case how can the history > mechanism function? > > Do you guys know a way to get around this problem? > > Thanks. > > -Girish > > -- > "unix soi qui mal y pense" > > UNIX to him who evil thinks Try setting 'sappend' flag on .bash_history with chflags(1). Yuri