일반 user 가 sudo 명령으로 root 권한의 명령어를 실행하기위해서는
/etc/sudoers file에 일반 user에 대한 권한 설정을 추가해 주어야 한다.
sudo visudo
The Default Ubuntu Sudoers File
# /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # See the man page for details on how to write a sudoers file. # Defaults env_reset # Uncomment to allow members of group sudo to not need a password # %sudo ALL=NOPASSWD: ALL # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL %ALL=(ALL) ALL # groupid group에 root권한 부여 ALL=(ALL) ALLL # userid에 root권한 부여
Shutting Down From The Console Without A Password
Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/halt, /sbin/reboot
ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS