misc/172965: pw useradd does not allow -g ""

J B jb.1234abcd at gmail.com
Mon Oct 22 21:40:01 UTC 2012


The following reply was made to PR misc/172965; it has been noted by GNATS.

From: J B <jb.1234abcd at gmail.com>
To: bug-followup at FreeBSD.org, jeff at bovine.net
Cc:  
Subject: Re: misc/172965: pw useradd does not allow -g ""
Date: Mon, 22 Oct 2012 23:35:49 +0200

 You took it out of context.
 
 $ man pw
 ...
      The useradd command also has the ability to set new user and group
      defaults by using the -D option.  Instead of adding a new user, pw writes
      a new set of defaults to its configuration file, /etc/pw.conf.  When
      using the -D option, you must not use either -n name or -u uid or an
      error will result.  Use of -D changes the meaning of several command line
      switches in the useradd command.  These are:
 
      -D            Set default values in /etc/pw.conf configuration file, or a
                    different named configuration file if the -C config option
                    is used.
 ...
 
 # pw useradd -D -g ""
 # cat /etc/pw.conf
 ...
 # Default group (leave blank for new group per user)
 defaultgroup = ""
 ...
 # pw useradd moo3
 # grep -i moo3 /etc/passwd
 moo3:*:1005:1005:User &:/home/moo3:/bin/sh
 
 # pw useradd -D -g "nobody"
 # cat /etc/pw.conf
 ...
 # Default group (leave blank for new group per user)
 defaultgroup = "nobody"
 ...
 # pw useradd moo4
 # grep -i moo4 /etc/passwd
 moo4:*:1006:65534:User &:/home/moo4:/bin/sh
 
 jb


More information about the freebsd-bugs mailing list