zoukankan      html  css  js  c++  java
  • CentOS8/Linux:用户组设置密码和删除密码

    CentOS8/Linux:用户组设置密码和删除密码

    一、建立用户组和删除:horse

    [root@test ~]# groupadd  horse

    [root@test ~]# groupdel  horse

    二、用户组的密码管理

    1、gpasswd基础知识

    [root@test ~]# gpasswd -h
    Usage: gpasswd [option] GROUP

    Options:
    -a, --add USER add USER to GROUP
    -d, --delete USER remove USER from GROUP
    -h, --help display this help message and exit
    -Q, --root CHROOT_DIR directory to chroot into
    -r, --delete-password remove the GROUP's password
    -R, --restrict restrict access to GROUP to its members
    -M, --members USER,... set the list of members of GROUP
    -A, --administrators ADMIN,...
    set the list of administrators for GROUP
    Except for the -A and -M options, the options cannot be combined.
    [root@test ~]#

    2、为用户组horse设置密码:

    [root@test ~]# gpasswd horse
    Changing the password for group horse
    New Password:
    Re-enter new password:
    [root@test ~]#

    3、为用户组horse删除密码:

    [root@test ~]# gpasswd -r horse 

    三、用户组的用户管理

    1、gpasswd基础知识

    [root@test ~]# gpasswd -h
    Usage: gpasswd [option] GROUP

    Options:
    -a, --add USER add USER to GROUP
    -d, --delete USER remove USER from GROUP
    -h, --help display this help message and exit
    -Q, --root CHROOT_DIR directory to chroot into
    -r, --delete-password remove the GROUP's password
    -R, --restrict restrict access to GROUP to its members
    -M, --members USER,... set the list of members of GROUP
    -A, --administrators ADMIN,...
    set the list of administrators for GROUP
    Except for the -A and -M options, the options cannot be combined.
    [root@test ~]#

    2、为用户组horse添加用户

    [root@test ~]# gpasswd -a root horse    #为用户组horse添加用户root
    Adding user root to group horse
    [root@test ~]# gpasswd -a laohu horse   #为用户组horse添加用户laohu
    Adding user laohu to group horse
    [root@test ~]#

    3、为用户组horse删除用户

    [root@test ~]# gpasswd -d root horse    #为用户组horse删除用户root
    Removing user root from group horse
    [root@test ~]# gpasswd -d laohu horse    #为用户组horse删除用户laohu
    Removing user laohu from group horse
    [root@test ~]#

    本文由lnlidawei(https://www.cnblogs.com/lnlidawei)原创或整理,转载请注明出处。
  • 相关阅读:
    一球从100米高度自由落下, 每次落地后反跳回原高度的一半; 再落下,求它在第10次落地时, 共经过多少米?第10次反弹多高?
    输入某年某月某日,判断这一天是这一年的第几天?
    一、spring——helloWorld
    遍历Map的四种方法
    六、IO流——文件
    五、集合
    在java项目中使用log4j的实例
    Nginx配置文件nginx.conf中文详解(总结)
    Windows7下安装搭建Ngnix教程
    第七课 文件存储
  • 原文地址:https://www.cnblogs.com/lnlidawei/p/12969731.html
Copyright © 2011-2022 走看看