Page 35 - RHEL8 BOOK
P. 35

11. Create a user shyam whose shell is ksh
          [root@sun ~] # cat /etc/shells
          [root@sun ~] # useradd -s /bin/ksh shyam
          [root@sun ~] # grep shyam /etc/passwd
          shyam:x:2004:2004::/home/shyam:/bin/ksh

          12.  Create a user abdul with all parameters as in scenario
          [root@sun ~] # useradd -u 2000 -g salesgrp -c "Director" -d /salesdept/abdul -m -s /bin/csh abdul
          [root@sun ~] # grep abdul /etc/passwd
          abdul:x:2000:2000:Director:/salesdept/abdul:/bin/csh

          13. To modify the parameter of existing user abdul
          [root@sun ~] # groupadd fingrp
          [root@sun ~] # mkdir /findept
          [root@sun ~] # usermod -u 3000 -g fingrp -c "Mang" -d /findept/abdul -m -s /bin/ksh abdul

          14. Change the user name
          [root@sun ~] # useradd scott
          [root@sun ~] # grep scott /etc/passwd
          [root@sun ~] # usermod -l tiger scott
          [root@sun ~] # grep tiger /etc/passwd

          15. To Lock the Account/user
          [root@sun ~] # usermod -L tom

          16. To unlock the account / user
          [root@sun ~] # usermod -U tom

          17. To delete the user
          [root@sun ~] # userdel tom
          [root@sun ~] # ls /home/

          18. To delete the user from permanently from user home directory
          [root@sun ~] # userdel -r tom
          [root@sun ~] # ls /home/

          19.To see the password detail
          [root@sun ~] # chage -l tom

          20.To set the password detail
          [root@sun ~] # chage tom
          Note: - Chage: - we can modify or we can manage the user password related information.
          21. Adding users on GUI Mode (Adding, Modifying & Deleting a user)
          [root@sun ~] # system-config-users &


                                                       S. Pradhan
                             (MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
                                             Email Id:-spradhan.iiht@gmail.com
                                                           35
   30   31   32   33   34   35   36   37   38   39   40