Subject: Linux Administrator                                                      Exp No.   3

 

Aim of the Experiment: To manage local  users and groups in Linux

 

Software Required:

1.     VMware

2.     Rhel 7.0

 

 

 

 

 

Theory:   

User Management: To create users, delete users, modify existing users, to done these types of managements called User Management.

In this experiment we will learn, to create users, delete users, to modify existing users, to set reasonable defaults for all field in (/etc/passwd) , some default managements such as range of valid UID numbers and default password aging rules,  that can be read from the (  /etc/login.defs ) file.

Some switching users command,  su and sudo.

 

 

Implementation/Steps:

                        First, i started the virtual machine.

                        Then in the Terminal I did practice with commands.

                        Such as:

                                    To add a new user.                              useradd Ram

                                    To assign password for Ram .             passwd Ram

                                    To delete a user                                  userdel Ram

                                    To check logged in user.                    #id

                                    To check Ram’s  id.                           #Ram id

                                    To see ownership of a particular file #ls –l filename

                                    To see owner of the Process               #ps –ef  or ps –au

                                    To see the user account information  #gedit /etc/passwd

                                    To create a group                                #groupadd diploma

                                    To delete a group                                #groupdel diploma    

 

Switching User With Su and Sudo

 

su: This command  allows a user to switch to different a user account. But it doesn’t give us clear login and also requires password for the particular user.

          #su Ram      (It will take us to Ram’s account)

          #su root       (It will take us to root’s account)

          #su               (If we don’t mention user, will also take us to Root)

       


Here I’ve not used (-) so, its not clear login.

 

su - : This command also perform same task as su but gives us a clear login .

          #su -  Ram   (It will take us to Ram’s account)

          #su - root     (It will take us to root’s account)

          #su -            (If we don’t mention user, will also take us to Root)

 


       Here I’vet used (-) so, it gave me clear login.

 

 

#exit             (This command is used to return previous logged account.)

 

sudo: By using this command we get clear login and, doesn’t need password to login, but whatever changes we do here it will be recorded in log file.  Administrator can see, whatever I have done over here.

#sudo Ram      (This cmd. allows us to switch Ram’s  account, without Ram’s password.)

#sudo -            (Through this cmd. I can switch to Root account, instead of giving root password, have to give my password)

 

Conclusion:

                        Now I’ve some knowledge about user management in linux.

 

                                                                                                 

 

                                                                                             

 

 

Post a Comment

أحدث أقدم