Saturday, 30 July 2011

4. User Management ( Real Time)


4. User Management

# id      (find out the user id information)
# dispuid        
# dispgid
# logins
# cat /etc/default/fs
Local = ufs
#listusers         (show no.of users)

Note: for user, there should be ‘home directory’.



Issues in user management:
ü  User permission
ü  User home directory missing
ü  Change the ownership (chown)
ü  Assign the permission (chmod)
ü  User missing in shadow file (pwconv)

User environment variable:
  1. local.cshrc
  2. local.login
  3. local.profile
All file exists in /etc/skel file

# logins –l raj

How to assign groupid to user?
# groupadd unix
#usermod –g unix raj  (-g : primary group name)
# logins –l raj
#id –a raj
# usermod –G dba,dwh raj

Note: if not specifying anything to create user, it means it stored in /home

To find defadduser:
# find / -name defadduser  -print

# login –xl pra

$ ls –ltr
raj
$exit

Changing the owner ship: before it was raj, now I am changing as root
#chown root:other /sai/raj/aa

# ls –l /sai/raj/aa
#chown root:dba /sai/raj/aa
# groups
# dispgid
# cat /etc/group
Sol:143:-----     (3rd one,if secondary group (-G) only it shows)

‘#userdel’ is a command to del the user but it cant delete the user home directories
#userdel –r:     command delete the home directory

To change the user name;
#usermod –l  roja raj




To change the group name:
#groupmod –n java sol

# man groupadd
# groupadd  ---

Above two, it show the options

#lf –F
#useradd –D (if it fire then only defadduser updates)
#cat /usr/sadm/defadduser

Issue1:
User entry missing in shadow
A: sync from passwd to shadow (pwconv)
# pwconv

Note: we can not sync from shadow to password.

Issue 2:
Password break
A: go to filesafe mode
# cd /a
#vi etc/shadow
    root/x/                 (remove 2nd part i.e  x)

in system1:
# dtrace           /it trace all the system calls

In system2:
# rm     // rm commands not working
Now in system 1 it shows error message, it trace why ‘rm’ not working

#passwd –n 2 –w 3 –x 10 raj

User id creation: LDAP – secure – advance of NIS+
Configuration: implementation team take care

Note :
  1. Once ticket comes for production server till 5 days no need to do anything.
  2. Application & DBA both should be shutdown for rebooting the server

Issue 3: home directory missing

# useradd –u 144 –g dba –d /sai/ram –m ram
# usermod –d /opt/ram –m ram           (b4 ram was in sai)
# cd /opt
# ls
ram (now in /opt from /sai, in /sai not there)



issue 4: chage the ownership

# ls –ld /opt/ram
I want to change the owner ship from ram to raj
#ls –ltr
Ram dba
I want raj to access ram
#chown raj:dba /opt/ram/aa

#ls –ld /opt/ram/aa

Issue 5: only one user not loging in
ü  Check the permissions
ü  Check out the password, user
ü  Check password status, grep | username

Issue 6: one user not accessing other file
ü  Check user permissions
ü  File level permissions
Note: its not day to day activity depends on requirement

Issue 7:not a single user login to server
Then it is a server problem


Issue 8: if shadow file missing
A: sync
#pwconv

Issue 9: if passwd/opasswd file missing
A: Reconstruct

No comments:

Post a Comment