Re: root /etc/csh



On Tuesday 11 November 2008 00:19:32 Daniel Howard wrote:
On Mon, Nov 10, 2008 at 1:46 PM, Pieter Donche <Pieter.Donche@xxxxxxxx>
wrote:
FreeBSD 7.0 comes with the user root with start up shell /bin/csh
As normal user I use bash (/usr/local/bin/bash installed)
I would prefer to have bash also when working as root (su).
Of course I can do
# bash
[root ~]# or I could change the startup shell in /etc/passwd, but would
that be a wise
thing to do or not?

If your system is having a bad time, falling back to statically-linked
/bin/csh

/bin/csh is not statically linked. /rescue/csh is.

can help you out in a jam, whereas pointing way off to
/usr/local/bin/bash could spell trouble if say, you can not mount
/usr.

More likely trouble scenario is gettext library version bump. However, bash
can be statically compiled by the port and you can also set $PREFIX to /, so
it gets installed as /bin/bash.
That said, you should before you change root's shell have dealt with a broken
root shell a few times, to be able to ascertain whether this extra problem is
something you want to deal with, at the times you already have a more
pressing problem to solve.


As prad pointed out, you can "su -m". I myself prefer "sudo -s".

Unfortunately, sudo -i is not a substitute for su -l, as sudo tries to be more
secure then it should be, cleaning the environment, preserving PATH, rather
then taking the correct values from /etc/login.conf. Most notably tilde and
dollar sign expansion, which are great *shell-independant* features:
$ grep setenv /etc/login.conf
:setenv=MAIL=/var/mail/$,BLOCKSIZE=M,FTP_PASSIVE_MODE=YES,PACKAGES=/var/pkg/7-stable,PKG_PATH=/var/pkg/7-stable\c.
\c/home/$/packages,CCACHE_DIR=/var/db/ccache/$:\

$ echo {$CCACHE_DIR:=No}
/var/db/ccache/mel

$ echo $MAIL
/var/mail/mel

$ sudo -c root -i
# echo ${CCACHE_DIR:=No}
No
# echo $MAIL
/var/mail/mel


--
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: soft-coding a script
    ... echo $CURRENT; ... you can use ${PWD} rather than `pwd`. ... I forget that my predilection toward whitespace is a bummer for bash until it rises up and bites me again. ... sudo: fredify2.sh: command not found ...
    (comp.unix.programmer)
  • Re: dir /b
    ... > Bash (at the command line, ... > $ echo qw!er ... GNU bash, version 2.05b.0-release ... [root@halo root]# mkdir -p example/1 ...
    (comp.unix.shell)
  • Re: echo bug?
    ... Subject: echo bug? ... Now I thought sudo was the equivalent to root permissions? ...
    (Ubuntu)
  • Re: [Full-disclosure] Todd Miller Sudo local root exploit discovered by Slouching
    ... ....but if the 'sudoers' file is correctly configured then you would not ... have the appropriate sudo permission to run the 'sudoedit' as root. ... user is not allowed to execute './sudoedit test' as root on this ... echo Tod Miller Sudo local root exploit ...
    (Full-Disclosure)
  • Re: Todd Miller Sudo local root exploit discovered by Slouching
    ... ....but if the 'sudoers' file is correctly configured then you would not ... have the appropriate sudo permission to run the 'sudoedit' as root. ... user is not allowed to execute './sudoedit test' as root on this ... echo Tod Miller Sudo local root exploit ...
    (Bugtraq)