User Accounts

Any user that wants to use Unix system must have a login name or username defined to the system. This login name identifies the user. When a newuser is added to unix systems systems administrator assigns it a unique login name which is associated with a number called UID or user identification number. This UID is the systems way of identifying the user. Typically, a newuser is also assigned to a group, group is collection of users in one department or working on one project identified with one group name. Each group is identified with its GID number or group identification number. For example
ls -la command will produce following result. in /usr/ssb directory for sandeep.
drwxrwxrwx   2 ssb        users         1024 Nov  3 12:50 dusg
-rw-rw-rw-   1 ssb        users          348 Oct 30 09:46 dxi12
drwxrwxrwx   3 ssb        users         1024 Oct 21 10:38 gnu
drwxrwxrwx   2 ssb        users         1024 Sep 18 11:17 logs
-rwxr-xr-x   1 ssb        users         1726 Oct 23 12:11 mon12.ksh
It tells us that first dusg is a directory owned by ssb in users group with 1024 bytes created on Nov 3 at 12:50 PM.
So together UID and GID determine what kind of access rights a user has to files and directories.
These are procedures to add a new user to system.

How to enter user in passwd file.
Once you have all the data about user name things like. a typical entry in a /etc/passwd looks like
sbajwa:*:111:35:Sandeep Bajwa:/usr/sbajwa:/bin/ksh
each field is separated by a :
which tells that login id is sbajwa
password is nothing * means nothing.
UID is 111
Group id is 35
name is Sandeep Bajwa
home directory is is /usr/sbajwa
/bin/ksh is the shell being used

after this is done,the first thing to do is to assign a new password. for this above sbajwa account, new password can be assign by passwd command. i.e.
passwd sbajwa
Then at next prompt assign the new password.
To create a home directory for this user use mkdir and chown commands.
cd /usr/
mkdir sbajwa
chown sbajwa sbajwa
Since this user gets ksh when logs in we have to give him a default .profile file, if a user logs in with csh then .login file is used. These files are helpful for taks suc as here is a sample .login file to be used with csh
umask 022
setenv PATH /usr/local/bin:/usr/bin:~/bin
setenv EDITOR emacs
mesg y
set prompt = ' `hostname` -\!> '
setenv TERM=vt100
A sample .profile file with same values. will be
umask 022
export PATH=/usr/local/bin:/usr/bin:~/bin
export EDITOR=emacs
mesg y
PS1='`hostname` -\!>'
export TERM=vt100




Fundamentals of Unix Unix commands User Accounts Shell Programming
File Systems Networking Backups Security
Installing software Installing Hardware Performance Some Useful Scripts

Your suggestions and comments are welcome. Please e-mail me
Copyright reserved with Sandeep S Bajwa.