In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the Linux command gpasswd. I hope you will get something after reading this article. Let's discuss it together.
The Linux common command gpasswd is the workgroup file / etc/group and / etc/gshadow management tools under Linux, which are used to add or remove a user from a group.
Syntax gpasswd [optional] Group name optional parameters:
-a: add users to the group
-d: remove a user from a group
-A: specify an administrator
-M: the purpose of the specified group member is similar to that of-A
-r: delete password
-R: restrict users from logging in to the group. Only members of the group can join the group using newgrp.
For example, if the system has a peter account that is not a member of the groupname group, you need to enter a password to use newgrp.
Gpasswd groupname allows users to temporarily join as members of the group, and then the file group created by peter will also be groupname. So this approach temporarily allows peter to use other groups when creating files, rather than the group in which peter itself belongs.
So use gpasswd groupname to set the password, so that people who know the group password can temporarily switch to the groupname group function.
Gpasswd-A peter users so that peter is the administrator of the users group, you can do the following:
Gpasswd-a mary users gpasswd-an allen users Note: you can use the command usermod-G group_name user_name to add a user to a specified group, but the previously added group will be emptied.
So when you want to add a user to a group while keeping the previously added group, use the gpasswd command to add the action user:
Gpasswd-a user_name group_name has finished reading this article, I believe you have a certain understanding of "how to use Linux commands gpasswd". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.