root@hm1:~# adduser hduser sudo
Adding user `hduser' to group `sudo' ...
Adding user hduser to group sudo
Done.
为了防止以后用hduser使用sudo时候遇到如下错误:
hduser is not in the sudoers file. This incident will be reported.
需要用visudo命令编辑文件/etc/sudoers, 添加一行
# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL
hduser ALL=(ALL) ALL