I faced this problem when I created a new account using command line where the default shell of my new account is /bin/sh. After googling around, I found 2 useful solutions which are listed below:
1. Change user entry in /etc/passwd
a) edit /etc/passwd using any editor
- $ vi /etc/passwd
- foo:x:1001:1001::/home/foo:/bin/sh
- foo:x:1001:1001::/home/foo:/bin/bash
e) Logout and login back
2. Use chsh command
a) type chsh
- $ chsh
c) This screen will appear
- Enter the new value, or press ENTER for the default
Login Shell [/bin/sh]:
Done :)
3 comments:
You should use vipw instead of just vi the passwd file.
how about using the options from useradd command
# useradd foo -s /bin/bash
the user foo will be created with the /bin/bash shell allocated to him.. thanks..
You can change it permanently with the -D option.
# To see current settings
# useradd -D
# To change default shell for all new accounts
# useradd -D -s /bin/bash
Cheers,
Mitch Sheean
Post a Comment