Unix 权限:组如何在 Unix 中工作
这可能是一个重复(但没有找到它..)
当您在unix中输入ls -l
时,您会得到如下输出:
% ls -l
total 48
-rwxr--r-- ... change*
-rwxrwxrwx ... checkVersion*
-rwx------ ... info*
我知道第一组rwx设置用户权限,最后一组rwx设置用户权限。组设置“其他人”的权限。我认为第二个 rwx 组设置了“组”的权限。
我如何告诉群组中的人?我属于哪个组?我可以创建新群组吗?我的机器上定义的组在哪里?
编辑:我可以通过修改 /etc/groups 文件来修改组还是需要使用命令来完成?
This is probably a dup (but did not find it..)
When you type ls -l
in unix you get output like this:
% ls -l
total 48
-rwxr--r-- ... change*
-rwxrwxrwx ... checkVersion*
-rwx------ ... info*
I know that the first group of rwx sets the users permisions and the last group sets "everyone else's" permisions. I think that the second rwx group sets the "group"s permissions.
How can I tell people who are in the group? What group am I in? Can I create new groups? Where are the groups defined on my machine?
Edit: Can I modify groups by modifying the /etc/groups file or do I need to do it with a command?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以在
/etc/group
中编辑组,但最好使用系统命令,例如:groupadd
来创建一些组usermod
来对用户进行操作特别是将用户添加到组下面是一个将
yoda
用户附加到jedi
组的示例:usermod -A jedi yoda
请参阅每个命令的手册使用方法:
man groupadd
man usermod
You can edit group in
/etc/group
but it's really better to use system commands like :groupadd
to create some groupsusermod
to operate on user and especially add users to groupHere is a sample that append
yoda
user tojedi
group :usermod -A jedi yoda
see the manual of each command for usage :
man groupadd
man usermod
键入
要了解您所在的组,请在控制台上
。组成员列在 /etc/group 中
To know which groups you are in type
on the console.
The groups members are listed in /etc/group
这些组在
/etc/group
文件中定义。您将在那里找到组以及属于每个组的成员的帐户的列表。unix
groups
命令告诉您您的帐户属于哪些组。The groups are defined in the
/etc/group
file. You'll find a listing of the groups and the accounts that are members of each group there.The unix
groups
command tells you what groups your account is in.查看 /etc/passwd 文件。它有你的用户。然后查看/etc/group 文件。它有具有唯一 id 的组
check out the /etc/passwd file. it has your users. then check out the /etc/group file. it has the groups with unique id's