Lavannya wrote:
Hi,
It is a general question though but I myself could not figure it out , so
asking to the list,
In redhat linux, when I am booting the server in the single user mode, after
login if i check with ps -f , it shows the shell is /bin/sh. But echo $SHELL
though shows /bin/bash (as the root user shell is set with /bin/bash).
I expected ps -f will also give the result /bin/bash. Can anyone will point
me out where in /etc/inittab or /etc/init.d/rc.sysinit file, the shell is being
set as /bin/sh when the server is booted in single user mode?
Follow it through...
18:23 [sum...@bobtail ~]$ cat /etc/inittab | grep :1:
l1:1:wait:/etc/rc.d/rc 1
18:23 [sum...@bobtail ~]$
so read /etc/rc.d/rc to see what it does when runlevel=1
Discover what this does (I found it educational)
set `/sbin/runlevel`
Eventually. work out it's not done in the scripts:-( I thought it was,
Debian does something different, that is not what I want so I edit its
scripts.
In desperation, look at init:
18:39 [sum...@bobtail ~]$ strings /sbin/init | grep /bin/
/bin/sh
18:39 [sum...@bobtail ~]$
and there you have it.
Bear in mind that init is not logging root on, it's just providing an
unsecured shell. Debian deplores this, and uses sulogin instead. Since
that's not really much of a security measure (just try booting with
"init=/bin/bash" some time), and I find it causes pain, I change it when
I think of it.
--
Cheers
John
-- spambait
[email protected] [email protected]
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375
You cannot reply off-list:-)
_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list