Our speaker was Hershel Remer, who is also known as the unixrabbi or Rabbs. His presentation was on basic system administration and the UUASC.

He talked about what the UUASC has to offer. For more information on the UUASC go to their website at http://www.uuasc.org. For more information on Hershel or his book go to his site at http://www.rabbs.com.

He discussed adding and removing users and from the system. He showed how a user can be added by adding a line to the /etc/passwd file. In most systems the passwords have been moved from /etc/passwd to /etc/shadow so that non-root users aren't able to access them. The system attaches user IDs (UIDs) and group IDs (GIDs) to users which can be viewed using the 'id' command.


/etc/passwd

A sample /etc/passwd file:

root:x:0:1:Super-User:/root:/sbin/sh
daemon:x:1:1::/:
bin:x:2:2::/usr/bin:
sys:x:3:3::/:
adm:x:4:4:Admin:/var/adm:
lp:x:71:8:Line Printer Admin:/usr/spool/lp:
uucp:x:5:5:uucp Admin:/usr/lib/uucp:
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/
...

The fields are colon (:) delimited and they are:

the username
the password or an x to indicate the password is in the /etc/shadow file
the user ID (UID)
the group ID (GID)
a comment for the administrator, usually the full name of the user
the user's home directory
the user's default shell

useradd

The syntax for creating a user with the useradd command is:

useradd -u (uid) -g (gid) -c (user's name, phone number, and marital status) -d /home/(username) -m -k /etc/skel -s (shell) (username)

The UID and the GID of the new user must be set using -u (uid) -g (gid) . A new UID can be found by looking at /etc/passwd.

When creating users, a home directory must be prepared for the new users, and the skeleton of the new user's home directory is usually taken from /etc/skel. That is automatically done with the useradd command's -d /home/(username) -m -k /etc/skel section.

A shell for the new user can be specified using -s . Some examples of shells might be /bin/csh for the C shell, /bin/bash for the Bourne again shell, or /bin/ksh for the korn shell.

The username of the new user is specified last in the useradd command.

To set a password for the new account, passwd (username) could be used.

/etc/shadow fields:

Login name

Encrypted password

Days since Jan 1, 1970 that password was last changed

Days before password may be changed

Days after which password must be changed

Days before password is to expire that user is warned

Days after password expires that account is disabled

Days since Jan 1, 1970 that account is disabled

A reserved field

All of that can be manipulated using the passwd command

Also, look at the man pages for the following commands:

useradd

usermod

userdel

passwd

id





2000-2007 Hershel Remer, All Rights Reserved.