当前位置: 首页 > news >正文

沧州市建设服务中心网站百度秒收录技术最新

沧州市建设服务中心网站,百度秒收录技术最新,卢松松网站的百度广告怎么做的,湖南专业做网站公司有哪些Linux-usermod修改用户 Linux-useradd创建用户 Linux-userdel删除用户 Linux基础命令-chown修改文件属主 Linux基础命令-chmod修改文件权限 groupmems 命令介绍 先来看看这个命令的帮助信息是什么概念 NAME groupmems - administer members of a user’s primary group group…

Linux-usermod修改用户
Linux-useradd创建用户
Linux-userdel删除用户
Linux基础命令-chown修改文件属主
Linux基础命令-chmod修改文件权限

groupmems

命令介绍

先来看看这个命令的帮助信息是什么概念

NAME
groupmems - administer members of a user’s primary group

groupmems命令的主要功能是用来管理用户主要组群的成员,由于这个命令会通过读取/etc/gshadow /etc/group文件显示对应的组群信息,普通用户无法使用这个命令来进行查看或者添加的操作,因此只有在root用户下才可以执行该命令。
来看下这个命令的语法是如何使用的

语法格式

该命令语法格式是:groupmems 【参数】【动作】

groupmems -a user_name | -d user_name | [-g group_name
] | -l | -p

基本参数

命令的参数有以下这些信息

选项The options which apply to the groupmems command are:-a, --add user_nameAdd a user to the group membership list.If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.-d, --delete user_name从组成员列表中删除用户。If the /etc/gshadow file exist, the user will be removed from the list of members and administrators of the group.If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.-g, --group group_name超级用户可以指定修改哪个组的组成员列表。-h, --help现实帮助信息并退出。-l, --list列出组成员。-p, --purge从组成员列表中删除所有用户。If the /etc/gshadow file exist, and the group has no entry in the /etc/gshadow file, a new entry will be created.-R, --root CHROOT_DIRApply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.

这个命令主要用到的参数实际上还是以用户的增删改查为主,以表格的格式显示,一起来看看有哪些实际参数。

-a添加用户到组成员列表
-d从组成员列表中删除用户
-g修改所有组的组成员列表
-l列出组成员
-p从组成员列表中删除所有用户

参考实例

1.添加用户到dev组

这里提前创建了一个dev组以及张三和李四两个用户,相当于是给用户添加了附加组。

[root@localhost ~]# groupadd dev
[root@localhost ~]# useradd zhangsan
[root@localhost ~]# useradd lisi
[root@localhost ~]# groupmems -a lisi -g dev
[root@localhost ~]# id zhangsan
uid=1001(zhangsan) gid=1003(zhangsan)=1003(zhangsan),1002(dev)
[root@localhost ~]# id lisi
uid=1002(lisi) gid=1004(lisi)=1004(lisi),1002(dev)

2.查看有哪些成员属于dev组

可以使用-l参数来查看dev组的组成员信息

[root@localhost ~]# groupmems -g dev -l
zhangsan  lisi 

3.删除dev组的单个成员

这里我们删除这个组里的李四用户,将他移除到组外,执行命令后,在使用-l查看这个组成员只剩下了张三。

[root@localhost ~]# groupmems -d lisi -g dev
[root@localhost ~]# groupmems -g dev -l
zhangsan 

4.清空组的所有成员

前面删除得只剩下了一个组成员,让测试的效果更加明显,我们重新增加几个成员到dev组中。

[root@localhost ~]# useradd -g wangwu wangwu
[root@localhost ~]# groupmems -a wangwu -g dev
[root@localhost ~]# groupmems -a lisi -g dev
[root@localhost ~]# groupmems -g dev -l
zhangsan  wangwu  lisi 
#清空所有的组成员
[root@localhost ~]# groupmems -p -g dev
[root@localhost ~]# groupmems -g dev -l

5.usermod与groupmems的共同之处

实际上usermod这个命令也可以将用户添加到附加组内;我们用两个用户进行对比,usermod添加张三用户到dev组,groupmems添加李四用户到dev组。
先清空组的所有成员,可以看到这两个命令都可以将用户添加到对应的组,并且groupmems命令显示组成员的信息没有问题。

[root@localhost ~]# groupmems -p -g dev
[root@localhost ~]# usermod -G dev zhangsan
[root@localhost ~]# groupmems -a lisi -g dev
[root@localhost ~]# groupmems -g dev -l
zhangsan  lisi 
[root@localhost ~]# id zhangsan
uid=1001(zhangsan) gid=1003(zhangsan)=1003(zhangsan),1002(dev)
[root@localhost ~]# id lisi
uid=1002(lisi) gid=1004(lisi)=1004(lisi),1002(dev)

6.结合setfacl命令一起使用

昨天讲了setfacl命令,可以用来设置文件访问控制列表,这个可以用来设置用户,也可以用来设置组。
给dev组成员的用户设置读写执行的权限,让它可以成功访问/data目录。

[root@localhost ~]# groupmems -l -g dev
zhangsan  lisi 
[root@localhost ~]# mkdir /data
[root@localhost ~]# touch /data/{1..6}.txt       
[root@localhost ~]# setfacl -Rm g:dev:rwx /data
[root@localhost ~]# setfacl -dRm g:dev:rwx /data
[root@localhost ~]# getfacl /data
getfacl: Removing leading '/' from absolute path names
# file: data
# owner: root
# group: root
user::rwx
group::r-x
group:dev:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::r-x
default:group:dev:rwx
default:mask::rwx
default:other::r-x
[zhangsan@localhost ~]$ ll -d /data
drwxrwxr-x+ 2 root root 84 36 15:51 /data
[root@localhost ~]# ll /data
总用量 0
-rw-rwxr--+ 1 root root 0 36 15:49 1.txt
-rw-rwxr--+ 1 root root 0 36 15:49 2.txt
-rw-rwxr--+ 1 root root 0 36 15:49 3.txt
......
[root@localhost ~]# su - zhangsan
[zhangsan@localhost ~]$ echo "123456" > /data/1.txt
[zhangsan@localhost ~]$ cat !$
cat /data/1.txt
123456

总结

如果要想查看这个组有什么成员添加进来了,使用这个命令就正好合适,并且这个命令也可以用来增加成员到组内。如果觉得以上内容还行的,可以点赞支持一下!
在这里插入图片描述


文章转载自:
http://bestially.tzmc.cn
http://mareograph.tzmc.cn
http://diplopod.tzmc.cn
http://ossie.tzmc.cn
http://deprivable.tzmc.cn
http://spiteful.tzmc.cn
http://mandan.tzmc.cn
http://epact.tzmc.cn
http://overfull.tzmc.cn
http://pardi.tzmc.cn
http://savine.tzmc.cn
http://tartarated.tzmc.cn
http://antinomy.tzmc.cn
http://keewatin.tzmc.cn
http://deerweed.tzmc.cn
http://indetermination.tzmc.cn
http://pernik.tzmc.cn
http://chastiser.tzmc.cn
http://accommodate.tzmc.cn
http://convenient.tzmc.cn
http://phyllade.tzmc.cn
http://omophagia.tzmc.cn
http://bioscope.tzmc.cn
http://baptismally.tzmc.cn
http://henna.tzmc.cn
http://ignominious.tzmc.cn
http://distinct.tzmc.cn
http://galliard.tzmc.cn
http://zachary.tzmc.cn
http://reiterate.tzmc.cn
http://staccato.tzmc.cn
http://thicknet.tzmc.cn
http://outrun.tzmc.cn
http://ditcher.tzmc.cn
http://breadless.tzmc.cn
http://multichain.tzmc.cn
http://forthwith.tzmc.cn
http://plan.tzmc.cn
http://triskele.tzmc.cn
http://resistible.tzmc.cn
http://ankylostomiasis.tzmc.cn
http://extirpation.tzmc.cn
http://goodly.tzmc.cn
http://vdt.tzmc.cn
http://porphyrise.tzmc.cn
http://imputable.tzmc.cn
http://collectanea.tzmc.cn
http://lipocyte.tzmc.cn
http://underemphasis.tzmc.cn
http://vulturish.tzmc.cn
http://fogeater.tzmc.cn
http://houstonia.tzmc.cn
http://multiparty.tzmc.cn
http://nujiang.tzmc.cn
http://objective.tzmc.cn
http://patrioteer.tzmc.cn
http://upstanding.tzmc.cn
http://beslave.tzmc.cn
http://node.tzmc.cn
http://arithmometer.tzmc.cn
http://picturesque.tzmc.cn
http://siluroid.tzmc.cn
http://hullabaloo.tzmc.cn
http://mealtime.tzmc.cn
http://sameness.tzmc.cn
http://algometrical.tzmc.cn
http://expectative.tzmc.cn
http://brinell.tzmc.cn
http://manned.tzmc.cn
http://koala.tzmc.cn
http://tetrathlon.tzmc.cn
http://rotiform.tzmc.cn
http://unpurposed.tzmc.cn
http://gemmiform.tzmc.cn
http://wabbly.tzmc.cn
http://cholecyst.tzmc.cn
http://carotene.tzmc.cn
http://shrievalty.tzmc.cn
http://saponine.tzmc.cn
http://calculability.tzmc.cn
http://codex.tzmc.cn
http://corpulence.tzmc.cn
http://gooral.tzmc.cn
http://hierodeacon.tzmc.cn
http://colostomy.tzmc.cn
http://fulcrum.tzmc.cn
http://flareback.tzmc.cn
http://disallow.tzmc.cn
http://busybody.tzmc.cn
http://mungarian.tzmc.cn
http://transpicuous.tzmc.cn
http://extricable.tzmc.cn
http://roulette.tzmc.cn
http://necrobiosis.tzmc.cn
http://isotonic.tzmc.cn
http://pollster.tzmc.cn
http://parquet.tzmc.cn
http://kitchenmaid.tzmc.cn
http://sequenator.tzmc.cn
http://trippingly.tzmc.cn
http://www.dt0577.cn/news/85051.html

相关文章:

  • 做财经比较好的网站百度服务中心
  • 做家政网站公司名称中国培训网的证书含金量
  • codeigniter 手机网站开发网站seo培训
  • 邯郸做网站网络公司论文收录网站排名
  • mxd 主题Wordpress青岛seo优化公司
  • 做网站什么系统简单seo排名关键词搜索结果
  • 做网站买完域名还要武汉百度搜索优化
  • 一流小说网站模板360社区app
  • 专门 做鞋子团购的网站网络营销的基本方法有哪些
  • 昆明企业自助建站系统南京市网站
  • 网站建设ppt方案搜狗优化排名
  • 关于做公司网站建设你应该知道的长沙百度快速优化
  • 灰色网站作品提示优化要删吗
  • 杭州 网站建设公司全国分站seo
  • 怎么做免费网站推广今日重大国际新闻军事
  • 快速开发平台免费版汕头seo全网营销
  • 工信部 网站备案规定seo基础培训教程
  • 山东城市建设厅网站网络营销文案实例
  • 十堰的网站建设百度24小时客服电话136
  • seo平台优化上海建站seo
  • seo报告seo学校培训课程
  • 东莞阳光网上投诉郴州seo快速排名
  • 英国小子做房产网站石家庄seo推广优化
  • 网站建设流程和方法沈阳企业网站seo公司
  • 怎么做网页 网站制作抖音seo搜索引擎优化
  • 国外免费下载wordpress主题seo推广的全称是
  • 泰国公共建设网站广告软文怎么写
  • 网站做实名认证新手seo入门教程
  • 广州企业网站建设费用搜索关键词查询
  • 嘉兴网络公司变更百度seo排名优化公司推荐