Re: what is the freebsd version for useradd -M?

2002-09-19 Thread Jim Durham

On Wednesday 18 September 2002 06:52 pm, Bsd Neophyte wrote:
 --- Jim Durham [EMAIL PROTECTED] wrote:
  'pw' has different arguments based on the first argument. If you say
  'pw useradd' then -M is not valid. You'll see this if you carefully
  read the man page.

 i have, this is why i noted that there was no -M option for the
 useradd argument under pw

 apparently, the -M under vanilla useradd indicates that a home
 directory is not to be created.  i was not, and still am not sure if there
 was a specific argument that allows for this.  from the looks if it i
 guess there isn't.


Hmmm... I just looked at my script to create users here and the argument
-m is used. Experimenting shows that -m causes a home directory to be
created, whereas the lack of -m causes the user to be added but no home
directory created. The current man page for 'pw' does not show -m as
an arg for 'pw useradd'. This is apparently wrong. It works as described
below under the '-m' arg description with 'pw useradd'.

-Jim


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



Re: what is the freebsd version for useradd -M?

2002-09-19 Thread Roman Neuhauser

# [EMAIL PROTECTED] / 2002-09-19 10:06:50 -0400:
 The current man page for 'pw' does not show -m as an arg for 'pw
 useradd'.

it does:

SYNOPSIS
 pw [-V etcdir] useradd [name|uid] [-C config] [-q] [-n name] [-u uid]
[-c comment] [-d dir] [-e date] [-p date] [-g group] [-G grouplist]
[-m] [-k dir] [-w method] [-s shell] [-o] [-L class] [-h fd] [-N] [-P]
[-Y]

...

 -m This option instructs pw to attempt to create the user's
home directory.  While primarily useful when adding a new


-- 
begin 666 nonexistent.vbs
FreeBSD 4.7-RC
4:16PM up 1 day, 23:31, 26 users, load averages: 0.00, 0.00, 0.00
end

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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Matthew Seaman

On Tue, Sep 17, 2002 at 04:25:51PM -0700, Bsd Neophyte wrote:

 useradd -c Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$

That's the Linux useradd command: you can see the man page at
http://www.freebsd.org/cgi/man.cgi?query=useraddapropos=0sektion=0manpath=Red+Hat+Linux%2Fi386+7.3format=html

The flags mean:

-c Samba ODC for MYDOMAIN  Real (GCOS) name for account

-M   Don't create home dir for account,
 even if default is to do so.

-s /bin/falseUse /bin/false as shell

-n   Add group of same name as user to
 be default group for account

PERSEUS$ Username for account.

As I remember, the trailing $ sign is significant for Samba when acting
as a domain controller.

In the BSD idiom, the equivalent would be something like:

pw useradd -n 'PERSEUS$' -c Samba ODC for MYDOMAIN -d /nonexistent \
-s /sbin/nologin

except that pw will complain that '$' is not a valid character in a
username.  Off hand the only way I can think of to get round that is
to create the account without the '$' and then use vipw(8) to add it
after the fact:

# pw useradd -n 'PERSEUS' -c Samba ODC for MYDOMAIN -d /nonexistent \
-s /sbin/nologin
# vipw
# vi /etc/group
# id 'PERSEUS$'
uid=1002(PERSEUS$) gid=1002(PERSEUS$) groups=1002(PERSEUS$)

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
  Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Giorgos Keramidas

On 2002-09-17 16:25, Bsd Neophyte [EMAIL PROTECTED] wrote:

 i'm setting up samba on my FreeBSD box.  the goal is to make it a PDC.
 i'm following the directions from Samba Unleased by SAMS.
 in the instructions, there's mention that each machine needs to have a
 user account on the server.
 it gives the following command to setup a machine account:
 
 useradd -c Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$

There is no useradd command in FreeBSD.  You probably want to use
pw(8) for adding users, but then it's probably the -m option that you
are supposed to use (to create the user's HOME directory too).  The -m
option of pw(8) has to be combined with a -d /home/dir option though,
otherwise pw(8) won't know where to create the user's home directory.

 i'm assuming i need to use pw useradd.  when i try i get an error.

Quite probably, yes.  In any case, the instructions of the book are
apparently written with the Linux way of doing things in mind (I think
useradd is a Linuxism, originating in the SysV roots of Linux).

Try reading the manpage of pw(8) on FreeBSD and guessing which options
you want to use, by reading the text of the Samba book and not the
exact command line.

- Giorgos

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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Nathan Kinkade

On Wed, 18 Sep 2002 12:05:14 +0300
Giorgos Keramidas [EMAIL PROTECTED] wrote:

 On 2002-09-17 16:25, Bsd Neophyte [EMAIL PROTECTED] wrote:
 
  i'm setting up samba on my FreeBSD box.  the goal is to make it a
  PDC. i'm following the directions from Samba Unleased by SAMS.
  in the instructions, there's mention that each machine needs to have
  a user account on the server.
  it gives the following command to setup a machine account:
  
  useradd -c Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$
 
 There is no useradd command in FreeBSD.  You probably want to use
 pw(8) for adding users, but then it's probably the -m option that you
 are supposed to use (to create the user's HOME directory too).  The -m
 option of pw(8) has to be combined with a -d /home/dir option though,
 otherwise pw(8) won't know where to create the user's home directory.

What are the drawbacks of using the `adduser -s` command?  Above, you
say, There is no useradd command in FreeBSD.  Yet you don't mention
the similar, but transposed, `adduser` command.  I've always used the
`adduser -s` command.  Should I not be using this utility?

Thanks, Nathan

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



(fwd) Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Giorgos Keramidas

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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Jim Durham

On Tuesday 17 September 2002 07:25 pm, Bsd Neophyte wrote:
 i'm setting up samba on my FreeBSD box.  the goal is to make it a PDC.

 i'm following the directions from Samba Unleased by SAMS.

 in the instructions, there's mention that each machine needs to have a
 user account on the server.

 it gives the following command to setup a machine account:

 useradd -c Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$

 now, I don't know what the -M stands for when you add a user.  i'm
 assuming i need to use pw useradd.  when i try i get an error.

 the man page for pw shows a -M, but it's only used for the groupadd
 option.

 i would like to know what i should use instead of the -M.

 any and all help will be appreciated.


'pw' has different arguments based on the first argument. If you say
'pw useradd' then -M is not valid. You'll see this if you carefully
read the man page.

What I think you want is -g groupname . IE; for group 'staff, it would
be 'pw useradd username -g staff  -y /dev/null -s /bin/false' . I'm not sure 
this works right with machine accounts, where the last character of the user 
name is '$'. I've never tried it. I just run 'vipw' and add the line.

username$:I:4055:3000::0:0:Machine Foobo:/dev/null:/bin/false

Then you run 'smbpasswd -a -m username' .

-jim



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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Giorgos Keramidas

On 2002-09-18 08:01, Nathan Kinkade [EMAIL PROTECTED] wrote:
 On Wed, 18 Sep 2002 12:05:14 +0300
 Giorgos Keramidas [EMAIL PROTECTED] wrote:
  There is no useradd command in FreeBSD.  You probably want to use
  pw(8) for adding users, but then it's probably the -m option that you
  are supposed to use (to create the user's HOME directory too).

 What are the drawbacks of using the `adduser -s` command?  Above, you
 say, There is no useradd command in FreeBSD.  Yet you don't mention
 the similar, but transposed, `adduser` command.  I've always used the
 `adduser -s` command.  Should I not be using this utility?

I like commands that can be scripted, without requiring any user
intervention from the terminal.  So far, I've used pw(8) with great
results, but this is clearly a matter of preference.

-- 
Giorgos Keramidas % keramida@{ceid.upatras.gr,freebsd.org}
FreeBSD 4.5-RELEASE-p20 #14: Tue Sep 17 15:23:24 EEST 2002

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



Re: what is the freebsd version for useradd -M?

2002-09-18 Thread Bsd Neophyte


--- Jim Durham [EMAIL PROTECTED] wrote:
 'pw' has different arguments based on the first argument. If you say
 'pw useradd' then -M is not valid. You'll see this if you carefully
 read the man page.

i have, this is why i noted that there was no -M option for the
useradd argument under pw

apparently, the -M under vanilla useradd indicates that a home
directory is not to be created.  i was not, and still am not sure if there
was a specific argument that allows for this.  from the looks if it i
guess there isn't.

__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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



what is the freebsd version for useradd -M?

2002-09-17 Thread Bsd Neophyte


i'm setting up samba on my FreeBSD box.  the goal is to make it a PDC.

i'm following the directions from Samba Unleased by SAMS.

in the instructions, there's mention that each machine needs to have a
user account on the server.

it gives the following command to setup a machine account:

useradd -c Samba ODC fir MYDOMAIN' -M -s /bin/false -n PERSEUS$

now, I don't know what the -M stands for when you add a user.  i'm
assuming i need to use pw useradd.  when i try i get an error.

the man page for pw shows a -M, but it's only used for the groupadd
option.

i would like to know what i should use instead of the -M.

any and all help will be appreciated.

__
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

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