After exchanging a couple of private messages with <[EMAIL PROTECTED]> he
mentioned that the following post made a couple of things more clear
to him/her, and asked me to forward it to the list too.

- Giorgos

----- Forwarded message -----
Date: Wed, 18 Sep 2002 15:42:03 +0300
From: Giorgos Keramidas <[EMAIL PROTECTED]>
Subject: Re: what is the freebsd version for "useradd -M"?
To: Robert Backhaus <[EMAIL PROTECTED]>

On 2002-09-18 05:25, Robert Backhaus <[EMAIL PROTECTED]> wrote:
> --- Giorgos Keramidas <[EMAIL PROTECTED]> wrote:
> > >
> > > useradd -c "Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$
>
> According to this reference -
> -c is the comment
> -M Do not create a home directory
> -s The shell (Generally, we use /sbin/nologin)
> -n Do not create a group for the user
> `PERSEUS$' - appears to be the login name, which I would have to say
> sounds unusual.

That's alright.  The usernames of "special" things in the Windows
world end in '$' characters.  Silly and misleading, but still a fact.

> for me, it's a toss-up whether I create this with the adduser(8)
> script, or `directly' using vipw(8). As I do not need the group and
> home dir that adduser creates, it's vipw.

The -n option seems rather weird, since the user *has* to belong to an
existing group.  The minimal set of commands to add a new user who
will have 'users' as her primary group name, is in FreeBSD:

        # pw groupadd users
        # pw useradd -g users keramida -c 'Giorgos Keramidas' \
          -d /home/keramida -m -k /usr/share/skel -s /usr/local/bin/bash

The first one creates a 'users' group if it doesn't exist.

The second one creates a new user, whose username is 'keramida'.  The
rest of the options are, well, optional and are indicative of how I
call pw(8) in my system, but you can tweak those to suit your
preference.  The manpage of pw(8) should be of great aid in
understanding what each option does.

An equivalent of your sample command for Samba would be:

        # pw useradd -g sambausers 'PERSEUS$' -s /bin/false \
          -c 'Samba ODC fir MYDOMAIN'

Someone has noted that pw(8) will now allow the use of '$' in
usernames, but you can always use:

        # pw useradd -g sambausers 'PERSEUS' -s /bin/false \
          -c 'Samba ODC fir MYDOMAIN'

and then use vipw(8) to change the username to 'PERSEUS$'.

> And as I use vi for all my editing, that's no problem either. For
> the viphobic out there, is there an emacspw?

Sure. vipw(8) respects EDITOR and VISUAL when found in the user
environment.  You could, for instance, use something like:

        # export EDITOR='emacs'
        # vipw

to make vipw(8) fire up Emacs as the editor, instead of vi(1).

- Giorgos

----- End forwarded message -----

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to