User Information (Easy Questions!)

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Aug 5 12:12:43 UTC 2006


beno wrote:
> Hi;
> * How do I find out which users have access to the box and what their
> permissions/groups are?

Type:

    % id username

which will tell you the users' UID and what groups they are a member of.

> * How do I edit those permissions/groups?

Unless you're using NIS or LDAP or some other directory program, then
all you need to do is edit the /etc/master.passwd and /etc/group files.
You can do that directly; use the vipw(8) command to edit
the password file safely and to automatically rebuild /etc/passwd the 
various .db files from /etc/master.passwd, but beware that screwing up
the password file can lock you out of the machine.

However using the pw(8) command is recommended.

> * If I delete a user, does that affect the files/programs he installed,
> etc?

No -- file and program ownership is recorded in the filesystem using
the UID and GID numbers.  Deleting the user from the password file removes
the human readable name and the password needed to log in and the mapping
from username to UID.  The files will still exist in the system, but
when you look at the ownership of them using ls(1) you'll see a number 
instead of a name for the owner.

Note: this is potentially a problem.  If the UID number gets reused for a
different account, that new user will get all the ownership rights to the
old users' files.  It can often be a better policy to disable an old account
-- set the password field in /etc/master.passwd to '!!' and change the shell
to /sbin/nologin -- rather than to delete it.

You can also get a report on any 'unowned' files in the weekly periodic
e-mail by adding

    weekly_noid_enable="YES"

to /etc/periodic.conf

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20060805/91ba3fa9/signature.pgp


More information about the freebsd-questions mailing list