Changing default shell to bash


 
Thread Tools Search this Thread
Operating Systems HP-UX Changing default shell to bash
# 1  
Old 07-22-2013
Changing default shell to bash

According to multiple sources you should not change the default shell to bash for the root user because it will make the system unbootable.

Is there a safe way to launch bash for root when logging in? Perhaps I can edit /etc/profile or add it to a startup script somewhere?
# 2  
Old 07-22-2013
sh is statically linked and, as such, does not rely on libraries that may reside on filesystems which are not mounted during the boot process, when the shell is needed, or in the event of a failure (or recovery). The implication being that other shells, such as Bash, are reliant on external libraries that may reside on filesystems not available when required.

If it's applicable to your system and that's what the folks over at that HP forum suggest, then it's still sound advice to adhere to. Besides, it's easy to launch bash from your .profile to make that your 'default' shell after login.
This User Gave Thanks to Scott For This Post:
# 3  
Old 07-23-2013
I would agree that setting the root shell is a dangerous thing as there could be code run at boot that assumes the shell has not been changed. It should run the code that calls in the /sbin/init.d scripts with a sh call, but will that calling script work in bash is another question. You would have to check so much that it's probably not worth it and any patches might undo any adjustments you may have to make.

Could I suggest that you don't login as root directly anyway. Unless this is only ever going to be a personal system, there is a likelihood that you will need to share the password at some point.

A more controlled/audit-able way is to log in as a standard user and use su to become the root user. If you have sudo privileges, then it's even easier. You could put a one-line script in your path similar to this:-
Code:
sudo su - root -s /bin/bash

I would consider preventing root login except from the console, both for telnet and SSH connections. Change and secure the root password and have that only used in a dire emergency.


I hope that this helps.
This User Gave Thanks to rbatte1 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing from bash to ksh

Hello, I want to run a script written in ksh but my default shell is bash as root e.g in the script it has #!/bin/ksh i have gone into /etc/passwd to change it from :/bin/bash to /bin/ksh but still giving me an error when running scripts such as ./installer -bash: ./installer: /bin/ksh:... (3 Replies)
Discussion started by: DOkuwa
3 Replies

2. Shell Programming and Scripting

Changing date using bash script

I am trying to change dates in a bash script. I have a start time and an endtime and want to increment the times. Basically the month and day have to be incremented in a loop to create two strings, stm and etm defining the start and end times. stm="2014-05-13T00:00:00"... (4 Replies)
Discussion started by: novilatte
4 Replies

3. UNIX for Dummies Questions & Answers

Rename multiple files in shell bash, changing elements order.

Hi, I want to rename several files like this: example: A0805120817.BHN A0805120818.BHN ..... to: 20120817.0805.N 20120818.0805.N ...... How can i do this via terminal or in shell bash script ? thanks, (6 Replies)
Discussion started by: pintolcv
6 Replies

4. Ubuntu

error LD: undefined variable while changing shell from bash to csh

Hi, i am a beginner in ubuntu. my default shell is bash. everytime i try to change the shell with command "csh", i get a message (probably an error message). after i get into c-shell, when i try to execute a c shellscript, then it showed the same message. any idea about what is this about or any... (1 Reply)
Discussion started by: Avinash Nayak
1 Replies

5. Shell Programming and Scripting

Bash - changing a color of a substring

Hello! I need to write a bash script for my university classes, and I came up with an idea of a program that would test the speed of typing - there is some random text that you have to rewrite, and the script measures time, number of mistakes etc. The text would be visible on the screen all... (3 Replies)
Discussion started by: xqwzts
3 Replies

6. Shell Programming and Scripting

changing cron using bash script

How can I change the cron entries only for ABC and XYZ from dosomething_1.0.sh to nowchanged_2.0 using a bash script ? Any help will be appreciated. # # ABC 00,05,10,15,20,25,30,35,40,45,50,55 * * * * /mydir/dosomething_1.0.sh 1>/dev/null 2>&1 # # ## # DEF... (4 Replies)
Discussion started by: jville
4 Replies

7. Shell Programming and Scripting

bash changing file name

I want to run some unix commands on one file..let say if i change the name and that name of file is present already. I dnt want to change that presnt file but instead of that make another one with different name eg.. usa.txt if it is there make usa.txt.1 something like that Also one more... (5 Replies)
Discussion started by: Learnerabc
5 Replies

8. UNIX for Dummies Questions & Answers

Changing default login shell

Hi everybody, The problem is quite simple, I want to change my default shell which is /bin/csh to /bin/bash. I have looked online for solutions to my problem, but to no avail. I have tried chsh, but it tells me this: chsh: can only change local entries; use ypchsh instead. I use ypchsh,... (7 Replies)
Discussion started by: z1dane
7 Replies

9. OS X (Apple)

Changing Default Shell

I bought a used MacBook G4 with Tiger 10.4.11 Running fine, then I noticed a few things were missing. I don't have Terminal or Netinfo Manager in my Utilities! I downloaded iTerm, but for some reason my shell is set to /dev/null I know I can change my shell using Netinfo Manager, but I don't... (5 Replies)
Discussion started by: Ricardo-san
5 Replies

10. UNIX for Dummies Questions & Answers

Need help with changing bash to perl

Hi guys, I am converting a bash script to perl. I need lots of help and pointers on how to make the script work. Any help would be greatly appreciated. Here is what I have: #!/usr/bin/perl #Decrypt Files $dir = "/usr/bin/gpg; opendir(PGP_DIR, $dir) || die "can't opendir $dir: $!";... (3 Replies)
Discussion started by: freak
3 Replies
Login or Register to Ask a Question