Linux Users and Groups - Base knowledge

Sometimes you have confused about Linux user, in this article, I show you:

How to find out what groups?
/etc/group is a text file which defines the groups on the Linux system. You can use 'groups' command toe display group memberships using the following syntax:
groups user-name

How do I find out the primary group membership?
getent group user-name

Add a new group
groupadd group-name

Add an existing user to a group
usermod -a -G group-name user-name

Change user's primary group
usermod -g group-name user-name

View a list of all groups
groups

Delete group
groupdel group-name

Thank you for reading this article, please a comment if you are interested.


Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment