Thursday, February 2, 2012

Users and Groups in Linux - 2

Delete user

userdel command used for delete user. We can do it with root user.

#userdel -f username
     // -f for delete user home directory.

Delete group

groupdel command used for delete group. We can use it with root user.

#groupdel groupname

Files in Linux for User and Group
  • passwd
  • shadow
  • group
  • gshadow

          The passwd file is used for store Linux User account information. And it'll be located in /etc/passwd. It contains root and system user accounts information also. So if any wrong changes happened it affect full Linux system. It only have read permission for all user and have edit permission for root.

          The shadow file is mainly used for store Linux User's login passwords as encrypted. It located in /etc/shadow. It's encrypted passwords. So we can't use this passwords straightly for login. The root user only can access this file anything view are edit. Other user don't have permission to view this file.

          The group file is as like passwd file. passwd is used to store user account information as like group file is used to store group information. It is located at /etc/group. It mainly used for store group name and their user name. Normal user can view this file. But only the root user can edit this.

          The gshadow is group password file, It is used for encrypted passwords of group. It is also as like shadow file. It is located at /etc/gshadow.The normal user can's view this and root user only can view and edit.

* Use man pages for more help.

No comments: