Sunday, June 1, 2014

Useful Linux Commands for User handling

1) How to find out under which user session you are working ?
         use "whoami" to find out user name of user currently active

 2) How to add new user ?
                   >useradd your_user_name
                   >sudo useradd your_user_name

 3) How to change password of user ?
                 >passwd your_user_name
                >sudo passwd your_user_name

 4) Delete a user
               >userdel user_name_to_delete 
5) List all users on Linux Box
             >cat /etc/passwd

6) How to find out current Users & their process?
     'w' is command that we can use here

7) Currently logged in users:
       To list currently logged in users 'who' command can be used

8) How to see all groups ?
       To list out all groups on your machine
            >cat /etc/group

 Please use manpages for more details about each command like say 
          >whoami  -h

Thanks & Happy Weekend!

No comments:

Post a Comment