newly added users have sh instead of bash shell

Bug #64700 reported by unggnu
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet
New
Undecided
Unassigned
puppet (Ubuntu)
Triaged
Low
Unassigned
shadow (Ubuntu)
Confirmed
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.

Revision history for this message
unggnu (unggnu) wrote :

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

Revision history for this message
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

Revision history for this message
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).

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
Przemek K. (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
Revision history for this message
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).

Revision history for this message
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?

Revision history for this message
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)
Changed in puppet (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Mathias Gug (mathiaz) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.