Linux权限基础

添加用户

adduser chung
password xxx

开放Sudo

[root@VM_0_6_centos ~]# whereis sudoers
sudoers: /etc/sudoers /etc/sudoers.d /usr/libexec/sudoers.so /usr/share/man/man5/sudoers.5.gz
[root@VM_0_6_centos ~]# ls -l /etc/sudoers
-r--r----- 1 root root 3907 Jun 23  2017 /etc/sudoers
[root@VM_0_6_centos ~]# chmod -v u+w /etc/sudoers
mode of ‘/etc/sudoers’ changed from 0440 (r--r-----) to 0640 (rw-r-----)

给用户设置组

 groupadd developers
 1. 用户存在的情况下
 usermod -a -G developers chung
 -a = append , 只有-G的话 就直接覆盖了除用户主要组以外的所有组
 
 2. 用户不存在的情况下
 useradd -G developers chung
 
 3. 修改用户的主要组
 usermod -g backend chung
 chung : backend developer
 
 4. 查看用户所有组
 groups chung

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。