(add new users & groups)

Rob stopspam at users.sourceforge.net
Fri Jun 11 19:56:40 PDT 2004


LW Ellis wrote:
> OK, I got that part down..
> (sysinstall and adding the user)
> I've ordered a FreeBSD book based on the recommendations I received here
> (this list)
> Until then I'm pretty much shooting in the dark, learning as I go.
> 
> I'm not clear on the Unix group/user setup
>>From what I have read, FreeBSD will place users in a default group
> Do I need a group? I will have about 6 users (not all at once)
> DO I add a group before users?
> Will it be to my benefit down the road to make a group now?

Every 'thing' in Unix should be a "user" and belong to a "group".
These are basically numbers: user-ID and group-ID.

So everytime you add a user to the system, that user will also get
a group-ID.

On my system I am user "1001", and in group "1005". The files
/etc/passwd and /etc/group map these numbers to nice names.
On my system these numbers map to the user-group names "lahaye"
and "surfion", for example.

These user-IDs and group-IDs are the essential part of permissions
in Unix. Permissions that (dis)allow a user to view or execute files;
to browse directries etc. etc. Do an "ls -l" and you see to which
user/group the files and directories belong. E.g:

$ ls -l .xsession
-rwxr-xr-x  1 lahaye  surfion  613 Apr 10 19:58 .xsession

(As an aside, sometimes, by mistake, files or directories have a
user or group ID that is not listed in /etc/passwd and/or /etc/group;
in that case the system cannot do the mapping to nice names, and you
get the bare numbers!).

The user/group concept clarify who can access what.
For example, there is you, your family members, and the big world outside.

Say you add yourself as
   user=leon, group=ellis

Then add your brother, father etc. as
   user=john, group=ellis
   user=dad, group=ellis

When you create a file, you then decide who can access this file.
1) Only you (none of the family members, neither the outside world)
2) You and all family members
3) Everybody (you, family and everybody else)

To make things a little more complicated: you can specify this separately
for 'reading', 'writing', and 'executing'. See the "chmod" command for details.

This is a starting point for learning more on the basics of Unix and
its files/directories permission strategy.

Happy Unixing,
Rob.




More information about the freebsd-questions mailing list