Tuesday, May 11, 2010

Default Shell in FreeBSD 8.0

So, I've been setting up a FreeBSD machine to function as a firewall/router. So far it has gone very smoothly and very quickly, but there has been one hiccup that drove me up a wall: the shell.

Apparently, if you use the installer to configure a user account with csh, you don't actually get csh. I found this out because I wanted command-line completion. I don't even need anything fancier than that for configuring this box, but I can't live without command-line completion -- it's ingrained in my muscle memory!

If you edit /etc/passwd to set your shell to csh, you don't actually get csh. Your environment will tell you that you are using csh, but it isn't actually csh. Therefore, adding options like "set autolist" to your .cshrc file won't do anything.

To make it work, I had to do "chsh -s /bin/csh," and I magically had command functioning again, without modifying any dot files.

I'm not accustomed to FreeBSD, but apparently this has something to do with the file etc/master.passwd which is used to generate /etc/passwd, so modifying your shell via /etc/passwd doesn't work, even if it appears to change.

Apparently, per some Google searches, I'm not the only one to find this very confusing!

No comments: