일반 user 가 sudo 명령으로 root 권한의 명령어를 실행하기위해서는
/etc/sudoers file에 일반 user에 대한 권한 설정을 추가해 주어야 한다.
1 |
sudo visudo |
The Default Ubuntu Sudoers File
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# /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 %<your groupname> ALL=(ALL) ALL # groupid group에 root권한 부여 <your username> ALL=(ALL) ALLL # userid에 root권한 부여 |
Shutting Down From The Console Without A Password
1 |
Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/halt, /sbin/reboot |
1 |
<your username> ALL=(ALL) NOPASSWD: SHUTDOWN_CMDS |
참조URL : https://help.ubuntu.com/community/Sudoers