Bug 706147 - /etc/shells should contain dash
Summary: /etc/shells should contain dash
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: dash
Version: 6.0
Hardware: All
OS: All
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: Miroslav Hradílek
Depends On: 706138
Blocks: 836169
TreeView+ depends on / blocked
Reported: 2011-05-19 15:50 UTC by Petr Šabata
Modified: 2012-10-17 07:26 UTC (History)
7 users (show)

Fixed In Version: dash-
Doc Type: Bug Fix
Doc Text:
Cause: User with /bin/dash log-in shell tries to log in. Consequence: Use cannot log in because /bin/dash is not allowed log-in shell. Fix: When installing or upgrading dash package, /bin/dash is added into list of allowed log-in shells (/etc/shells). When uninstalling the package, the shell is removed from the from list. Result: Users with /bin/dash log-in shell can log into the system.
Clone Of: 706138
Last Closed: 2012-10-17 07:26:09 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1381 normal SHIPPED_LIVE dash bug fix update 2012-10-17 11:24:28 UTC

Description Petr Šabata 2011-05-19 15:50:39 UTC
+++ This bug was initially created as a clone of Bug #706138 +++

Description of problem:
Users can't use dash as their shell since it's not present in the /etc/shells file.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install dash.
2. Try to set dash as your shell (e.g. via chsh)
Actual results:
chsh: "/bin/dash" is not listed in /etc/shells.

Expected results:
Shell changed.

Additional info:
This can be solved via %post and %postun scriptlets.

--- Additional comment from psabata@redhat.com on 2011-05-19 17:30:06 CEST ---

if [ $1 -eq 1 ]; then
    grep -qF /bin/dash /etc/shells || echo '/bin/dash' >> /etc/shells

if [ $1 -eq 0 ]; then
    sed -i '/\/bin\/dash/d' /etc/shells

Comment 1 Petr Šabata 2011-05-19 15:52:08 UTC
Fixed in Fedora already (0.5.6-4 in f15+, 0.5.6-3 in f14).

Comment 5 Stephen Haffly 2011-11-14 03:20:57 UTC
Possibly in fixing this problem another was introduced.

I just upgraded from Fedora 15 to Fedora 16 using preupgrade. I went to start a VirtualBox session, and it complained that it could not do so. This was the error message:

ExtPackInst ExtPack: enmReason=1 iStatus=127 stderr='The value for the SHELL variable was not found the /etc/shells file

I looked at the /etc/shells file and found that /bin/bash was missing. However, /bin/dash was in the file twice.

Once I changed the first instance to /bin/bash, VirtualBox behaved fine. Please check the file as I am sure that it may be causing problems to others. I had not previously had any problem with this, so it had to have come in with the F16 upgrade.

Comment 6 Petr Šabata 2011-11-14 08:56:38 UTC

this is not a Fedora bug, I suppose you wanted to comment on 706138.

Anyway, /bin/dash was added to /etc/shells in F14 and doesn't touch /bin/bash record (or any other) at all.  All that is handled in dash %post and %postun scriptlets.

I also don't have /etc/bash in /etc/shells but I have /etc/dash there just once.

The file belongs to the 'setup' package.  Please, file a bug report with it.

What is also weird is bash users can login into the system although the record is missing...

Comment 7 Ondrej Vasik 2011-11-14 13:28:05 UTC
Default /etc/shells from setup contains just:

The rest of the shells is added by other packages. It would probably make sense to add the additional shells

and maybe others to the default /etc/shells file - as I don't like modifications of default system files by other packages...

Comment 8 Stephen Haffly 2011-11-14 13:36:56 UTC
Thanks. Done. Bug is 753780.

Comment 9 Stephen Haffly 2011-11-14 13:41:08 UTC
Interesting though, the /etc/shells on my netbook contained just 

No /bin/sh or any other entry.

The desktop, before I fixed it contained:


I changed the first /bin/dash to /bin/bash. This information was submitted as part of 753780, so I hope to see this fixed quickly.

Comment 10 Petr Šabata 2011-11-15 09:42:02 UTC
Both bash and dash should be fixed (in Fedora) now.

Comment 21 errata-xmlrpc 2012-10-17 07:26:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.