Subject: re: need help setting up user account--no faq exists!
To: port-mac68k mailing list <port-mac68k@NetBSD.ORG>
From: Steve Revilak <revilak@umbsky.cc.umb.edu>
List: port-mac68k
Date: 04/14/1998 11:09:14
"Eric B. Krauss" <ebkrauss@ls.wustl.edu> writes:

>I have tried to no avail to set up my user account.
>
>I can't find anything in the NetBSD faq's on setting up a user account.  My
>Sobell Unix book isn't helpful at all--I follow the instructions, use vipw,
>and keep getting a line corrupted error, and vi won't let me save the file.
>
>Can someone point me to a page (a page that is actually UP, not the *dead*
>links mentioned in the faq) that has these instructions?  Or, could someone
>just write these instructions down and email them to me, or better yet,
>post
>them somewhere?

I'm still new enough of a newbie to have wrestled through this fairly
recently...

Preliminary places to start-- man pages for adduser (general info for
adding a new user) and passwd (for the formatting of data in
/etc/master.passwd).  To begin, I logged in as root in multi-user mode....

I remeber encountering the vipw error you mention. I believe I got around
that by logging in as root, and using the command 'chfn' to change roots
finger information (root is line 1 of the master.passwd file).  Then,
'pwd_mkdb /etc/master.passwd' to rebuild the password database files.

Okay, so you're logged in as root.  You'll need to edit /etc/master.passwd.
Use 'vipw' or just edit the file directly ('pwd_mkdb /etc/master.passwd'
once you've finished.)

There are a bunch of fields, seperated by colons.  Below is an example:

root:*:0:0::0:0:Charlie &,,,:/root:/bin/csh

1) Username--this must be unique

2) Encrypted passwd (probably an '*' for most entries).  Leave this blank
for now (no white space).

3) User ID # - this must be a unique number

4) Group #.  You'll probably find that making yourself a 'wheel' member is
most useful.  The number for wheel is 0.

5) Class--you can just leave this blank.

6 & 7) I forget exactly what these are, but I believe they're not really
used by the system.  Enter Zeros.

8) Your personal name.  Just fill that in.  Ignore the '&,,,,' for now.

9) Home directory.  You should create a folder for yourself and list that
here.  (After doing so, don't forget to use 'chown' to change the ownership
of the folder--so that you own it)

10) Path of the shell you will use.  I used /bin/csh.

One thing you might find helpful...position your entry in the file so that
the user ID you assign yourself falls in ascending numerical order,
relative to the other User ID#s.  In vi, postion the cursor where you'd
like to insert the line, press ESC to make sure you're in command mode and
then type a capital O.


After you've finished with the password file, edit /etc/groups.  Find the
line that begins with 'wheel'.  After the last entry on the line add a
comma and your username (no white space).  You may also wish to add
yourself to operator as well.  (IIRC, master.passwd only contains your
primary group association.  Leave that as wheel (Group # 0) But it is okay
to list yourself several times in /etc/groups).

Next, a few files to have in your home directory:

.login
.chsrc (or .profile is you're using ksh)
You should find copies of this in either / or /root.  Just copy them into
your directory.  (Don't forget to use 'chown' to change the ownship of
these after copying).

.login--commands that are executed each time you log in.
.cshrc--commands executed each time your shell starts up.

These set user environment, create command line aliases, etc.

(Format for chown is 'chown <userid to change ownership to> <filename>).

Then try to log in as yourself.  Lastly, once you've logged in as yourself,
you may want to use 'chfn' (change finger information) to add your personal
info and 'chpass' to give yourself as password.

Again, this is being rattled off from memory (I'm in MacOS right now).
Please double check what I've said about the formatting of password files
with what's contained in passwd(5).

A fairly inexpensive book that helped me out tons (please don't laugh) was
"Teach Yourself Unix in 24 hours", published by SAMS.  It breaks the basics
down into a bunch of 1 hour lessons--it's very approachable, and I'd
reccomend it hightly to the beginner.  On the back cover, it says it has a
website http://www.intuitive.com/tyu24.  Haven't looked at that,
though....just bought the book.

Other relevant man pages-- csh, and a few that come up when you type
'apropos group'.

Good luck.


Steve Revilak
revilak@umbsky.cc.umb.edu