It will prompt you for password. Just put in your password.
Changing shell for root.
Password for root:
# Changing user information for root.
# Use "passwd" to change the password.
##
# Open Directory: /Local/Default
##
Login: root
Uid [#]: 0
Gid [# or name]: 0
Generated uid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
Home directory: /var/root
Shell: /bin/sh
Full Name: System Administrator
Office Location:
Office Phone:
Home Phone:
Issue below command to check root default shell, it should return you /bin/bash.
Password for root:
Then it will open up vi with below information. Move to 'Shell:/bin/sh line', and then press I to enter insert mode. Delete sh and replace it with bash. Then press , enter :wq and press to save file and quit.
# Changing user information for root.
# Use "passwd" to change the password.
##
# Open Directory: /Local/Default
##
Login: root
Uid [#]: 0
Gid [# or name]: 0
Generated uid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000
Home directory: /var/root
Shell: /bin/sh
Full Name: System Administrator
Office Location:
Office Phone:
Home Phone:
Issue below command to check root default shell, it should return you /bin/bash.
$ sudo echo $SHELL
Password:
/bin/bash
Password:
/bin/bash
4 comments:
What a life-saver! Best tip I've read all day.
Thanks,
This is has been bugging me for ages!
Now if only I could figure out where root's PS1 variable was being set (not .bashrc apparently)!!!
Thank you Sir. You are a gentleman and a scholar.
you need to set SUDO_PS1 if you want to change root's PS1 when using sudo.
Also, I don't know if it matters, but I feel safer using exec /bin/bash in the .profile instead of changing the shell since I don't know if it would mess up shell scripts in the system.
Post a Comment