Subject: Re: Creating user accounts?
To: NetBSD list <>
From: Jukka Marin <>
List: amiga
Date: 10/12/1994 08:24:27
Forwarded message:
> From:
> Hi all.. I have some problems when trying to create a new account.
> I first type mkdir /home/test
> and then use vipw to add a line, something like:
> err cant remeber.. But anyway, I get no complanits when saving the file.
> If I then try to login, chs can't cd to /home/test, not to /home, and then
> succeeds with /.
> Could somebody please tell me how to create a new account (step-by-step)
> and which files that are involved?

First, I am just writing a script and a small C program to accomplish this.
When I finish the script, you'll be able to create a new account with one
command.  For now, do the following:

1) Create home directory for the user:
   mkdir /home/username

2) Copy .cshrc .login or any other files you want the user to have into
   the home directory.  I have /home/base to store these prototype files,
   so I can simply copy them all into the newly created directory.

3) Add the user to the passwd file using vipw.  Set password to * for now
   (prevents logins to that account).  Remember to set a proper uid and gid
   (and make sure that the gid exists in /etc/group).

4) Change the file owner for the /home/username and all files stored in it.
   For example, chmod -R username:user /home/username

5) Change the protection bits for the home directory to what you want.
   Use chmod 1700 /home/username for maximum security (other users can't
   access the home dir - but finger won't list their .plans either) or
   chmod 1755 /home/username for normal mode (read access for everyone).

6) Set quota for the user (if you are using quotas).  You can use
   edquota -p <prototype user> <new user> to set quotas in the same
   way as for the <prototype user>.

7) Set the initial password for the user using passwd <username> .

8) Set the account and password expiration times, if you want.  Use
   chpass <username> to accomplish this.  The times are given as
   "Jan 20, 1995" (no time of day can be set).

Your new account should work now.

BTW, I have a new passwd command which sets the password expiration
time to current time + 28 days.  The default passwd command just clears
the password change field, so the password never needs to be changed.

If there's interest for my makeaccount system (may not suit to every
need without modifications) or the new passwd command, I'll upload them

  Jukka Marin


| Mail:  Jukka Marin         |     E-Mail:  |
|        Metsurintie 17 B 8  |     FAX/voice:        +358 71 283 2793     |
|        70150 Kuopio        | There's God above computers -              |
|        FINLAND             |                       Love beyond the hate |
 \                                                                       /
  \ If a train station is where the train stops, what is a workstation? /