在Linux中如何将用户从sudo组中移除?

Posted by

在linux组中移除用户操作命令

命令: gpasswd -d userName groupName

gpasswd -d 用户 sudo
login as: root
root@120.78.178.239's password:
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Ubuntu's Kubernetes 1.14 distributions can bypass Docker and use containerd
   directly, see https://bit.ly/ubuntu-containerd or try it now with

     snap install microk8s --classic

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

Welcome to Alibaba Cloud Elastic Compute Service !

Last login: Wed Jun 26 16:22:15 2019 from 125.70.79.36
root@karat:~# clear
root@karat:~# id root
uid=0(root) gid=0(root) groups=0(root)
root@karat:~# id sun
uid=1000(sun) gid=1000(sun) groups=1000(sun),27(sudo)
root@karat:~# id aaron
uid=1002(aaron) gid=1002(aaron) groups=1002(aaron),27(sudo)
root@karat:~# id bill
uid=1001(bill) gid=1001(bill) grou


ps=1001(bill),27(sudo)
root@karat:~# id magento_user
uid=1004(magento_user) gid=1004(magento_user) groups=1004(magento_user),27(sudo)
root@karat:~# gpasswd -d magento_user sudo
Removing user magento_user from group sudo
root@karat:~# id magento_user
uid=1004(magento_user) gid=1004(magento_user) groups=1004(magento_user)
root@karat:~#

4 comments

  1. Thanks for all of the efforts on this web page. My daughter takes pleasure in working on investigation and it’s easy to understand why. A lot of people learn all regarding the compelling mode you give rewarding techniques through the blog and inspire response from website visitors on this article and our simple princess is undoubtedly discovering a whole lot. Take pleasure in the remaining portion of the year. You are always carrying out a fantastic job.

  2. Hiya very cool site!! Man .. Excellent .. Amazing .. I’ll bookmark your site and take the feeds also厈I am glad to find numerous useful info here within the publish, we want develop more techniques in this regard, thank you for sharing. . . . . .

  3. Good site! I really love how it is easy on my eyes and the data are well written. I’m wondering how I could be notified when a new post has been made. I’ve subscribed to your RSS which must do the trick! Have a great day!

  4. We absolutely love your blog and find almost all of your post’s to be precisely what I’m looking for. Would you offer guest writers to write content in your case? I wouldn’t mind creating a post or elaborating on many of the subjects you write concerning here. Again, awesome site!

Comments are closed.