USER & GROUP MANAGEMENT

 

GROUP:

# groupadd unixteam

# groupadd pusers

# groupadd –g 500 unixteam // Create a group called unixteam with GID 500

uid=108(oracle) gid=108(oinstall) groups=106(dba),107(oper) group add command and user add command also..

#groupadd -g 108 oinstall

#groupadd -g 106 dba

#groupadd -g 107 oper

# groupmod -n dbateam unixteam //Rename group & Change the name unixream to dbateam

Delete the group

# groupdel foxadmin // Remove the group called foxadmin

-n : change group name

-g :primary group

-G : secondaru group

USER:

# useradd -m prashant

# useradd -g unixteam -d /home/prashant -m -c " C Prashant Kumar from unix team" prashant ;passwd prashant // -g is adding group; -d is for directory; -m is mapping; -c is comment for user;

# useradd -u 1201 -g unixteam -m -d /home/prashant -c " C Prashant Kumar from unix team" prashant ; passwd prashant

#useradd -u 192 -g newgroup -s /usr/bin/sh -m -d /home/newuser newuser

#useradd -m -s /usr/bin/sh -g accounts -G staff,support prashant // user's primary group is 'accounts' and he is member of two other groups 'staff' & 'support'. shell assigned to the user is "/usr/bin/sh"

#useradd -D

#useradd -D -b /extra/home newuser

#useradd -m newuser

#useradd -f newuser

#useradd -e newuser

-D :to change the location of base directory

-m : home directory

-f :inactive if not login

-g :primary group

-G :secondary group

-e :expire

#usermod -u 230 newuser

#usermod -s /usr/bin/shell boota

#usermod -g newgroup newuser

#usermod -1 newuser

#usermod -e 9/4/12 newuser

NOTE:- The expiration can be turned off if you use an empty string with -e option. -e :change expire date

-1 :active for login

# usermod -G dbateam prashant // here existing user 'prashant' is adding to secondary group 'dbateam'

#userdel newuser

#userdel -r newuser

-r :remove its home directory

 

PLEASE WRITE A FEEDBACK OR SUGGESTIONS TO BELOW EMAIL ID’S.

prashantkumar.chawan@gmail.com

info@mytara.co.in