From owner-freebsd-current Sat Aug 11 11:55:51 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 8D43B37B429 for ; Sat, 11 Aug 2001 11:55:33 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f7BIt6k43178; Sat, 11 Aug 2001 14:55:06 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20010810233635.A12077@xor.obsecurity.org> References: <3B74D180.D036D629@hway.net> <20010810233635.A12077@xor.obsecurity.org> Date: Sat, 11 Aug 2001 14:55:03 -0400 To: Kris Kennaway , Jason Vervlied From: Garance A Drosihn Subject: Re: bash in /usr/local/bin? Cc: freebsd-current@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 11:36 PM -0700 8/10/01, Kris Kennaway wrote: >On Sat, Aug 11, 2001, Jason Vervlied wrote: > > Is there a reason why the bash shell is kept in /usr/local/bin. > >Ports get installed under ${PREFIX} (/usr/local by default). > > > I would personally prefer to use it for my root shell, but > > if I remember right, root needs to have something that is > > in /bin (I could be wrong). > >You are wrong. ... And you ARE the weakest link! :-) Seriously though, it would be mighty prudent to have the shell for userid root to be in some directory which is part of the root filesystem. I suspect that very few people keep /usr/local in their root filesystem. So, while a shell doesn't need to be in /bin per se, that IS a pretty popular place to put any shell which someone expects to use as the default for userid root. As to Jason's situation, I also like to use bash as my shell even when I am root. However, I do not want to muck around with the port for 'bash', or do anything else to move where bash is or how it's built. So, the way I decided to handle it was to add the following lines in the /root/.login file: if ( -x /usr/local/bin/bash ) then # echo "Switching to bash" exec /usr/local/bin/bash -login endif So, strictly speaking /bin/csh is still the default shell for root, but the effect for me is that I automatically get bash whenever I log in. This seems to work fine for me, and I am not aware of any problems which have been caused by this trick in the few years that I have been using it. Another tactic Jason could take is to follow the example of userid 'toor'. So, create a new userid called 'broot', with uid=0 (so it should act like 'root'), but set it's shell to /usr/local/bin/bash. I don't have any idea how well this would work in practice, but it might be something else to try. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message