Performing User Administration
/etc/passwd -- 7 fields loginID:x:UID:GID:comment:home_dir:login_shell
0 - 99 UID -- Reserved system user accounts
100 – 60000 -- UID for users range
0 -- Root
60001 -- Reserved for the nobody account
60002 -- Reserved for noaccess account -- To generate error message
65534 -- nobody4 The anoynomous user account
/etc/shadow -- 9 fields loginID:password:lastchg:min:max:warn:inactive:expire:reserved
/etc/group -- groupname:group-pwd:GID:user-list
/etc/default/passwd -- Set values for the following parameters MAXWEEKS MINWEEKS
PASSLENGTH (valid entries are 6,7 & 8) WARNWEEKS
1970 –-> V4
1986 -- Sun released first OS (sunos1.0)
# useradd –u
# passwd user300
# useradd –d /export/home/user305 –m user305
# useradd user306
# usermod [-u uid [-o]] [-g gid] [-G gid] [-d dir] [-m] [-s shell] [-c comment] [-l newloginname] loginname
# usermod –l
# usermod –u
# usermod –s /bin/csh user301
# userdel user301 -- Delete the user account not the home dir
# userdel –r user301 -- Delete user id & home dir
# groupadd [-g gid [-o]] groupname
# groupadd –g
# groupmod [-g gid [-o]] [-n name] groupname
# groupmod –n
# groupmod –g 400 class -- Change GID to 400 for the group class
# groupdel group1
/etc/profile -- The Bourne, Korn and BASH shells execute this initialization file
/etc/.login -- The C shell looks for and executes this initialization file during logon.
There are no default global initialization files for the Z or TC shells
Bourne /etc/profile $HOME/.profile /bin/sh /etc/skel/local.profile
Korn /etc/profile $HOME/.profile /bin/ksh /etc/skel/local.profile
$HOME/.kshrc
C /etc/.login $HOME/.cshrc /bin/csh /etc/skel/local.cshrc
$HOME/.login /etc/skell/local.login
Setting Environment Variables
Bourne or Korn shell VARIABLE=value; export VARIABLE
For example: PS1=”$HOSTNAME”; export PS1
C setenv variable value
For example: setenv LPDEST laserprinter
# id user301 -- Shows UID of the user & primary group
# id –a user301 -- Shows secondary group details also
# groups user300 -- Shows the users groups
# chown –R
# pwconv -- To sync passwd and shadow files.
/etc/skel -- Template files get copied once user id is created.
-- By default /etc/skel/.profile file don’t have any content.
Profile Order
/etc/motd file -- Message of the day
/etc/profile
/$HOME/.profile
No comments:
Post a Comment