1832858 Members
3041 Online
110048 Solutions
New Discussion

Re: default shell

 
Luiz Fernando
Occasional Advisor

default shell

Hello,

I downloaded and successfully installed bash from .depot file.

So, I wish to define bash as default shell for root account. I used SAM from HP to set this.

Meanwhile, when I changed root??s default shell from SH to BASH, I wasn??t able to log in FTP. I received the message: "530 - root access denyed..."

When I back to SH, all get OK again.

Can anyone help me?

thanks & regards,

Luiz Fernando
Luiz Fernando
15 REPLIES 15
Mark Vollmers
Esteemed Contributor

Re: default shell

Luiz-

short answer is that root has to be in sh shell. There have been a number of threads here about people who have had lots of problems when they start switching root shell. is there a reason why you want to change it?

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
harry d brown jr
Honored Contributor

Re: default shell

You really DO NOT want to change root from "sh" to "bash" because of many issues, like not being able to boot your machine. If you want to switch to bash after you have logged in, then that's not an issue, as I usually switch to ksh quite often.

live free or die
harry
Live Free or Die
Pete Randall
Outstanding Contributor

Re: default shell

Luiz,

Check the following thread, in particular Bill Hassell's comments:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x2efaa14d9abcd4118fef0090279cd0f9,00.html

Basically the idea is - DON'T

Pete

Pete
Jeff Schussele
Honored Contributor

Re: default shell

Hi Luiz,

DO NOT change the root's default shell...not only will you see ftp weirdness...YOU'LL NOT BE ABLE TO BOOT THE SYSTEM.

You can change the shell in a .profile command if you must...or from the command line or a script, etc.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
harry d brown jr
Honored Contributor

Re: default shell

Luiz,

Also, please read this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x96b70bce6f33d6118fff0090279cd0f9,00.html

live free or die
harry
Live Free or Die
Marcin Wicinski
Trusted Contributor

Re: default shell

Hi,
sh is mandatory for root.
Marcin Wicinski
Luiz Fernando
Occasional Advisor

Re: default shell

Hello,

thank you all...

I would like to explain why I want to change root??s shell.

I want to use the bash autocomplete feature, which is not present in sh. So I decided to change to bash.

But, as you said, I shouldn??t do this. So, I would like to know if is possible to use autocomplete feature in sh or if there is another way to call bash whenever I start a new terminal windows in hp-ux system.

I wait your comments,

thanks & regards,

Luiz Fernando
Luiz Fernando
Pete Randall
Outstanding Contributor

Re: default shell

Luiz,

You don't need bash. Stick with the posix shell as outlined in the threads you were pointed to. The posix shell offers file name completion (which is what I believe you were referring to when you said "auotcomplete feature") as well as history file/command line edit. It should be every thing you need.

And please assign points to responses - it's the only reward those that help you get and it's the only way for people reviewing this post in the future to tell which answers helped.

Good luck,
Pete

Pete
Shahul
Esteemed Contributor

Re: default shell

Hi

It is not suggested to change root's default shell. Try to keep /sbin/sh only. In case change is must, then add bash shell in /etc/shells file to work ftp.

Best of luck
Shahul
A. Clay Stephenson
Acclaimed Contributor

Re: default shell

If you really want to do this, it just might be possible but in order to do this you would have to download the source and compile/link a statically linked version and put in in /sbin while the dynamically linked pre-compiled version would remain in /usr/bin. I would then knock down to single-user with only / mounted and test it by invoking /sbin/bash from /sbin/sh. If that works, you should then be able to safely make bash the root shell. I still don't think that this is a good idea but it should be possible if you are really stubborn and wish to do this.
If it ain't broke, I can fix that.
Frank Slootweg
Honored Contributor

Re: default shell

As Pete mentioned, the default /sbin/sh POSIX shell probably has the "autocomplete feature" you want.

If not, please describe what exactly you mean by "autocomplete feature". If /sbin/sh indeed does not have that, we can give you a *safe* method for giving root a bash shell during normal operation.
harry d brown jr
Honored Contributor

Re: default shell

Luiz,

After you have logged in as root, simply type in either the path to "bash" or "bash" if it's in your PATH variable.

live free or die
harry
Live Free or Die
Bill Hassell
Honored Contributor

Re: default shell

The sh shell is not Bourne in HP-UX 10 and higher, it is the POSIX shell (just like bash and ksh). However, it has some security features and one is that it does NOT assume what the shell history file will be (for root).

To get filename completion (ESC-ESC or auto-completion) and also command stack recall (ESC-K, etc), put this line into /etc/profile:

export HISTFILE-$HOME/.sh_history

This should be set for ksh and BASH anyways, but now it enables all users that run POSIX shells (/sbin/sh, /usr/bin/sh, /usr/bin/ksh and so on) to have command recall and filename completion.


Bill Hassell, sysadmin
Pete Randall
Outstanding Contributor

Re: default shell

I think Bill meant
export HISTFILE=$HOME/.sh_history

Pete

Pete
Martin Johnson
Honored Contributor

Re: default shell

You could set up a pseudo root account that uses bash.

Marty