I have used
When I went to make this thread I realised that I accidentally ran
I have rebooted several times but $SHELL has not changed and xterm and urxvt start into sh. It's possible that I've done something foolish in a configuration file a year or more ago and forgotten about it... I am getting better, I just started reading Absolute FreeBSD today, I am up to the section on compiling kernels. It has inspired me to read the handbook back to back also.
An issue that cropped up in my googling was that sometimes the shell would not change if people were logged in from other machines... they would check this with the who command. This is my output:
This was after logging into X which I do by typing "startx". $SHELL is /bin/sh immediately after I log in also.
Thanks for any help.
Edit: Not sure if this is useful at all but I just enabled sshd and ssh'd to my FreeBSD box, still /bin/sh.
Edit2: Ok I solved it. Instead of running
Followed the errors and found https://forums.freebsd.org/threads/chsh-not-working.72695/
Logged out and back in and everything's good
I also realised that root's original shell was /bin/csh not /bin/sh.
chsh -s /usr/local/bin/bash
to change the default shell for my user from /bin/sh. bash is available in /etc/shells and the shell has been correctly updated for my user in /etc/passwd.
Code:
$ grep bash /etc/passwd
fl121:*:1000:1000:FreeBSD 12.1 User (Intel):/home/fl121:/usr/local/bin/bash
sudo chsh -s /usr/local/bin/bash
and changed root's shell to bash... I just changed that back... I'm not sure if that would have caused any problems as sh is a subset of bash.I have rebooted several times but $SHELL has not changed and xterm and urxvt start into sh. It's possible that I've done something foolish in a configuration file a year or more ago and forgotten about it... I am getting better, I just started reading Absolute FreeBSD today, I am up to the section on compiling kernels. It has inspired me to read the handbook back to back also.
An issue that cropped up in my googling was that sometimes the shell would not change if people were logged in from other machines... they would check this with the who command. This is my output:
Code:
$ w
4:46PM up 33 mins, 4 users, load averages: 0.82, 1.19, 1.18
USER TTY FROM LOGIN@ IDLE WHAT
fl121 v0 - 4:13PM 32 xinit /home/fl121/.xinitrc -- /usr/local/bin/X :0 -auth /home/fl121/.serverauth.11959
fl121 pts/0 :0 4:13PM 32 bash
fl121 pts/42 :0 4:13PM 32 sh
fl121 pts/41 :0 4:13PM 32 conky
Thanks for any help.
Edit: Not sure if this is useful at all but I just enabled sshd and ssh'd to my FreeBSD box, still /bin/sh.
Edit2: Ok I solved it. Instead of running
chsh -s /usr/local/bin/bash
as fl121 I tried switching to root and running chsh -s /usr/local/bin/bash fl121
and it returned:
Code:
chsh: entry inconsistent
chsh: pw_copy: Invalid argument
Runningpwd_mkdb -C /etc/passwd
gives
Code:pwd_mkdb: corrupted entry pwd_mkdb: at line #3 pwd_mkdb: /etc/passwd: Inappropriate file type or format
sudo vipw
---
Then make a trivial change, like adding a space to a comment in line 1 or 2, and "wq!"
Your password files should all be re-generated.
Logged out and back in and everything's good
I also realised that root's original shell was /bin/csh not /bin/sh.