수요일, 5월 22, 2024
HomeLinuxSudoers

Sudoers

일반 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

참조URL : https://help.ubuntu.com/community/Sudoers

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Time limit exceeded. Please complete the captcha once again.

Most Popular