Ubuntu

newly added users have sh instead of bash shell

Reported by unggnu on 2006-10-08
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet
New
Undecided
Unassigned
puppet (Ubuntu)
Low
Unassigned
shadow (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: passwd

If you add a new user without defining the shell or upgrade from Dapper and using additional user accounts then the standard one all got /bin/sh instead of /bin/bash. Then every user has only a "$" console instead of the standard format and tab completion and so on doesn't work. It is easy to fix through usermod -s /bin/bash USER but it is very confusing at first.
This happens as well with upgrades from Dapper as with new installation of Edgy but only for manual added users, not the standard account.

unggnu (unggnu) wrote :

This problem still exists in Feisty. Could anyone at least tell the reason for this behaviour?

James Dupin (james.dupin) wrote :

I might have some news for you...

The problem is not obvious maybe because lots of people are using the GUI to create users BUT if you create a user in CLI with useradd you will bump right away in the problem.

on both Gutsy and Hardy the default shell of useradd is sh
useradd -D gives SHELL=/bin/sh on both.
At the same time /etc/adduser.conf has DSHELL=/bin/bash

Shouldn't the default shell be the same for both useradd and adduser?

James Dupin

Gianni Moschini (gianni.net) wrote :

I have checked adduser and useradd commands too, and I think it should have the same default shell in both.

It's weird to have different values.

By the way, to reply to unggnu, the default is set to /bin/sh because this should be just a link to the default shell used on the system. It was ok then, when Ubuntu was still using bash as the target of /bin/sh, but from edgy, it has changed to dash instead of bash (to reduce the memory footprint if I remember correctly).

Colin Watson (cjwatson) wrote :

You really shouldn't be using useradd. It's a low-level tool with no bells and whistles or distribution-specific customisations. You should use adduser from the command line.

Thomas Kluyver (takluyver) wrote :

Confirmed that this setting is still present in Hardy. Setting to confirmed to now--if the position is that useradd is not for common use, and the default should remain sh for that, please set this to invalid.

Changed in shadow:
status: New → Confirmed
Przemysław Kulczycki (azrael) wrote :

Does this bug still appear in Karmic?

summary: - newly added users have sh instead of bash shell in Edgy
+ newly added users have sh instead of bash shell
Thomas Kluyver (takluyver) wrote :

Using useradd does indeed still create a user with sh (symlinked to dash) as their default shell. I still don't know whether this is a bug, or by design (because you ought to use adduser or a GUI tool).

Chris Jones (cmsj) wrote :

Regardless of the desire for people to use adduser, we are shipping two tools to create users with two different defaults. Is there a particular reason for /etc/default/useradd not to change to setting SHELL to /bin/bash?

Chris Jones (cmsj) wrote :

I've added a puppet task to this bug because by default our puppet packages call useradd, so unless a shell is specified in the manifest for a user, they will get a login shell of dash.

Mathias Gug (mathiaz) on 2010-08-03
Changed in puppet (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Mathias Gug (mathiaz) wrote :

I've reported the bug in puppet upstream at http://projects.puppetlabs.com/issues/4460

Robert Sajdok (ris) on 2010-11-14
tags: added: patch-forwarded-upstream
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers