[ubuntu-uk] Shell Access for VPS server

Alan Lord (News) alanslists at gmail.com
Tue Jul 7 09:35:42 BST 2009


On 07/07/09 08:20, William Anderson wrote:
> Alan Lord (News) wrote:
>> On 07/07/09 01:24, Sean Miller wrote:
>>> Not on my Ubuntu machine, my default user is still using bash.
>>
>> I would be surprised if the default shell is bash.
>>
>> /bin/sh is a symlink to /bin/dash as Dave explained.
>>
>> If you look at a user's default shell in /etc/passwd you will see most
>> (if not all) point to bin/sh. (Although interestingly I note that root
>> points to bin/bash).
>
> nope, /bin/sh may have been changed to point to dash instead of bash,
> but new users are created with their shell set to bash.  Every new
> account I've set up on every ubuntu box i've set up lately gets bash as
> their shell.

That's interesting. I wonder when this changed? Ubuntu was [in]famous 
for it's use of dash a couple of years ago but I just created a new test 
user and it's default shell is indeed bash.

Looking into /etc further however, the picture becomes somewhat cloudier...

/etc/adduser.conf specifies /bin/bash as the default login shell.

/etc/default/useradd specifies /bin/sh

# The SHELL variable specifies the default login shell on your
# system.
# Similar to DHSELL in adduser. However, we use "sh" here because
# useradd is a low level utility and should be as general

And /etc/login.defs (Which is referred to by man useradd for changing 
the default behaviour of useradd) has an interesting option FAKE_SHELL 
which can be used to call /bin/fakeshell first - although this is not 
present on my system.

> You may all be thinking "default shell" means the shell new users are
> set with to what sh points to.

I meant default shell as the one set in /etc/passwd which is what they 
are assigned when they first login.

The "default" shell is also what your shell script will point to if you 
don't start the file with a #!/bin/${SHELL}.

Looking through that again, it's interesting to note that all *system* 
users which require a shell are set to /bin/sh and *real* users (i.e. 
actual people and root) are set to /bin/bash.

Dash *is* actually the "default" shell for Ubuntu.

"In Ubuntu 6.10, the default system shell, /bin/sh, was changed to dash"
https://wiki.ubuntu.com/DashAsBinSh

The default *login* shell is bash.

Interesting little dig around that.

I also discovered the /etc/alternatives directory which is debian's way 
to manage defaults when there are multiple choices such as with text 
editors etc. man update-alternatives explains more.

Al




More information about the ubuntu-uk mailing list