Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

理解 Linux 文件权限 #8

Open
ghost opened this issue Jan 31, 2021 · 3 comments
Open

理解 Linux 文件权限 #8

ghost opened this issue Jan 31, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 31, 2021

https://archlinuxstudio.github.io/ShellTutorial/#/commandLine/security

Linux命令行与Shell脚本教程 包含常见命令行使用,Bash基础、高级编程,以及实用范例!

@huntagain2008
Copy link

huntagain2008 commented Dec 15, 2021

创建新组
$ sudo usermod -G shared test。

为用户账户分配组时要格外小心。如果加了-g 选项,指定的组名会替换掉该账户的默认组。-G 选项则将该组添加到用户的附加属组的列表里,不会影响默认组。

这里写错了。不是添加组到附加组的列表里。而是将用户从以前的组移除,只剩下shared这个组。大写的-G后面跟组列表。要用附加组是用-aG
参见 man usermod

我新手小白,昨天尝试配置了samba,建了新的组,用了usermod -G shared test 今天再开机,居然sudo不能用了,一看我的账户不在wheel组里面了。

@ryosukeeeeee
Copy link
Member

@huntagain2008 -G选项会覆盖附加组,不影响默认组。文档这里写的有问题,感谢你的反馈!

@brucmao
Copy link

brucmao commented Aug 31, 2022

以前对umask 一直不懂,看了这篇终于明白了,太开心了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants