linux 普通用户获得root用户权限

创建用户,设置密码

useradd test

passwd test

加入用户组 -G是追加用户组

usermod -G root test

newgrp root

查看当前用户组

gropus [user]

修改文件

vim /etc/sudoers

test ALL = (ALL) ALL

chmod -R 当前目录和子目录

7 读 + 写 + 执行 rwx 111
6 读 + 写 rw- 110
5 读 + 执行 r-x 101
4 只读 r-- 100
3 写 + 执行 -wx 011
2 只写 -w- 010
1 只执行 --x 001
0

猜你喜欢

转载自blog.csdn.net/csd_nuser/article/details/112955708