1.在root用户下,执行visudo命令
添加test ALL=(ALL) NOPASSWD: ALL (放在最后test为用户名)
2.在root用户下,将普通用户添加到用户组中,在指定相应的目录,就可以对此目录进行操作(mkdir rm等
[root@hadoop-yarn hadoop]# groupadd hadoop
groupadd: group 'hadoop' already exists
[root@hadoop-yarn hadoop]# chown hadoop:hadoop /dir
chown: 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