linux 将普通用户权限提升到管理员权限

来源:互联网 发布:程序员招聘要求 编辑:程序博客网 时间:2024/05/17 07:18

1.在root用户下,执行visudo命令

添加test ALL=(ALL) NOPASSWD: ALL (放在最后test为用户名)


2.在root用户下,将普通用户添加到用户组中,在指定相应的目录,就可以对此目录进行操作(mkdir rm等

[root@hadoop-yarn hadoop]# groupadd hadoopgroupadd: group 'hadoop' already exists[root@hadoop-yarn hadoop]# chown hadoop:hadoop /dirchown: cannot access `/dir': No such file or directory[root@hadoop-yarn hadoop]# <strong>chown -R hadoop:hadoop /opt # -R很重要表示循环遍历</strong>[root@hadoop-yarn hadoop]# chmod 777 /opt


0 0