← Back to team overview

touch-packages team mailing list archive

[Bug 1321854] Re: useradd doesn't add the default shell to /etc/passwd entry

 

Could this be a sign of useradd ignoring everything in
/etc/default/useradd? I've stumbled upon a problem when changing the
default HOME base directory. Example:

# useradd -D
GROUP=100
HOME=/tmp
INACTIVE=-1
EXPIRE=
SHELL=/bin/sh
SKEL=/etc/skel
CREATE_MAIL_SPOOL=no
# useradd -m testuser14
# grep testuser14 /etc/passwd
testuser14:x:5012:5012::/home/testuser14:

I think useradd is not only ignoring the SHELL variable (though I didn't
change it in this example), but also the rest of variables that appear
in /etc/default/useradd.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1321854

Title:
  useradd doesn't add the default shell to /etc/passwd entry

Status in shadow package in Ubuntu:
  Triaged
Status in shadow source package in Trusty:
  Triaged

Bug description:
  useradd is not honoring the default shell listed in
  /etc/defaults/useradd when creating new users.

  useradd -D showing the defaults. SHELL=/bin/bash

  # useradd -D
  GROUP=100
  HOME=/home
  INACTIVE=-1
  EXPIRE=
  SHELL=/bin/bash
  SKEL=/etc/skel
  CREATE_MAIL_SPOOL=no

  Using useradd to create user test1. The /etc/passwd entry has a blank
  shell field:

  # useradd test1
  # grep test1 /etc/passwd
  test1:x:2080:2080::/home/test1:

  Using useradd -s does populate the shell field:
  # useradd -s /bin/bash test2
  #grep test2 /etc/passwd
  test2:x:2081:2081::/home/test2:/bin/bash

  Why useradd instead of adduser: puppet uses useradd to do user
  creation.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: passwd 1:4.1.5.1-1ubuntu9
  ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
  Uname: Linux 3.13.0-24-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3
  Architecture: amd64
  Date: Wed May 21 17:51:57 2014
  Ec2AMI: ami-42dc302a
  Ec2AMIManifest: (unknown)
  Ec2AvailabilityZone: us-east-1d
  Ec2InstanceType: m3.large
  Ec2Kernel: aki-919dcaf8
  Ec2Ramdisk: unavailable
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: shadow
  UpgradeStatus: No upgrade log present (probably fresh install)
  mtime.conffile..etc.default.useradd: 2014-05-21T17:36:05.208686

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1321854/+subscriptions