Top Ad unit 728 × 90

Latest updates

recent

USER MODIFCATION PRACTICAL STEPS



'### TO ASSIGN THE COMMENT ###'
# useradd tom (create one user)
# tail /etc/passwd (to check)
# usermod -c <comment> <username>
# usermod -c "Sales Dept" tom
# grep tom /etc/passwd (to check)


'### TO CHANGE THE UID ###'
# useradd jack (create one more user)
# tail -2 /etc/passwd (to check)
To Provide User:jack Previlages to User:tom
# usermod -u <ID> -o <username>
# usermod -u 501 -o tom
# tail -2 /etc/passwd (to check)
Login with both the user's to check the result


'### TO CHANGE THE GID ###'
# groupmod -g <ID> <username>
# groupmod -g 600 tom
# grep tom /etc/passwd (to check)
Changing the GID means,taking the Group Privileges


'### TO CHANGE THE SHELL ###'
# cat /etc/shells (to check availabel shells)
# usermod -s <shell> <username>
# usermod -s /sbin/nologin tom (to block account)
# grep tom /etc/passwd (to check)
# su - tom (try to access tom account)


'### TO LOCK THE USER ACCOUNT ###'
# usermod -L <username>
# usermod -L jack (to lock)
# grep jack /etc/shadow (to check)
'!'sign indicates that the user account is lock
# gdmflexiserver (open one gui console)
Select the User:jack & try to login
# usermod -U tom (to unlock)
# grep jack /etc/shadow (to check)
# gdmflexiserver (open one gui console)
Select the User:jack & try to login


'### TO CHANGE THE USER HOME DIRECTORY ###'
# vi /etc/default/useradd (open this file)
Do the Modification in the HOME line,as below
HOME=/media
:wq(save & quit the file)
# useradd jerry (create one user)
# tail /etc/passwd (to check)


'### TO CHANGE THE USERNAME ###'
# usermod -l <newname> <oldname>
# usermod -l tom123 tom
# tail /etc/passwd (to check)


'### TO REMOVE A USER ###'
# userdel jack (to remove a user without its home directory &
mail account)
# tail /etc/passwd (to check)
# ls /home (to check home dir)
# ls /var/spool/mail (to check mail accout)
# userdel -r tom123 (to remove a user with its home directory &
mail account)
# tail /etc/passwd (to check)
# ls /home (to check)
# ls /var/spool/mail (to check)


USER MODIFCATION PRACTICAL STEPS Reviewed by Unknown on 6:46 PM Rating: 5
© 2007 - 2016. All Rights Reserved by Babashaheer Blog

Contact Form

Name

Email *

Message *

Powered by Blogger.