Linux设置组密码

news/2025/2/16 3:42:20/
一、建立用户组和删除: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 ~]#

 


http://www.ppmy.cn/news/832538.html

相关文章

修改树莓派用户密码

树莓派在安装系统之后都会有原始默认的用户名和密码,接下来我们可以自行修改树莓派的用户密码。 环境: 树莓派3 B型,树莓派系统:raspbian,默认的用户名:pi,默认密码:raspberry 修…

linux修改用户名、密码、用户组、设备名教程

标题:linux修改用户名、密码、用户组、设备名教程 第一步设置密码: 1、修改root密码(必须要做) sudo passwd root 2、修改用户密码(用户名为xxx) sudo passwd xxx 第二步修改主机名(可选&…

计算机更改家庭组密码,win7系统忘记家庭组密码的解决方法

很多小伙伴都遇到过win7系统忘记家庭组密码的困惑吧,一些朋友看过网上零散的win7系统忘记家庭组密码的处理方法,并没有完完全全明白win7系统忘记家庭组密码是如何解决的,今天小编准备了简单的解决办法,只需要按照 1、点击win7系统…

如何找到Windows 7或8家庭组密码?

So you’re about to setup your new Windows 7 PC into your Homegroup when you realized that you have no idea what the password is. How do you find it? It’s actually pretty simple, if you know where to look. 因此,当您意识到自己不知道密码是什么时…

无法从该家庭组删除您的计算机,无法更改家庭组或获取家庭组密码以加入家庭组...

我的设备名称是IDEA-PC,账户原先是一个名字为hao的本地账户,在使用这个账户期间创建了一个家庭组。把这个账户转换为在线账户后,我不在这个家庭组中。当我想对家庭组进行操作时,出现如下画面: 图中说,IDEA-…

计算机更改家庭组密码,Windows7中为家庭组设置密码后如何修改

Windows7中的家庭组是家庭网络上可以共享文件和打印机的一组计算机,它可以让我们共享更加方便简单,为了更加安全有很多人都会为自己的家庭组设置密码,但是最近我一朋友跟我说他想要修改一下家庭组的密码,但是却不知道要如何修改&a…

查看家庭组组计算机用户名密码是什么,设置win10系统查看家庭组密码的步骤介绍...

不知道小伙伴们在使用电脑工作的时候有没有遇到win10系统查看家庭组密码的问题,即便很容易处理,还是有朋友不知道win10系统查看家庭组密码到底如何处理。有关如何解决win10系统查看家庭组密码的问题也不难。只用你按照1、在Windows10桌面右下角找到网络图…

查看计算机用户组密码,电脑windows10系统家庭组密码查看的方法

计算机网络安全的重要性、计算机网络安全存在的问题以及防范措施等方面提出一些见解,并且进行了详细阐述,以使广大用户在使用计算机网络时增强安全防范意识。下面是学习啦小编为大家整理的关于电脑windows10系统家庭组密码查看的方法,一起来看看吧! 电脑windows10系…