develog

[bash] sudo, sudoers, ALL=(ALL:ALL) ALL 본문

OS & Shell/Linux

[bash] sudo, sudoers, ALL=(ALL:ALL) ALL

냐옴 2013. 7. 23. 13:47

root 계정으로 변경

$ su - root

root 계정으로 실행

# vi /etc/sudoers

## user1 에 권한 부여
user1    ALL=(ALL:ALL) ALL

## 패스워드 물어보지 않게 등록 | NOPASSWD: ALL
user1    ALL=(ALL)    NOPASSWD: ALL  #<--추가

## 원하는 명령어만 등록
user1    ALL=(ALL)    /usr/sbin/visudo, /usr/sbin/useradd, /usr/bin/userdel, /usr/sbin/usermod, /usr/bin/passwd

 

/etc/sudoers 기본 내용

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.

 

ALL=(ALL:ALL) ALL 의미

허가된_사용자=(호스트:명령을_실행하는_사용자) 허가된_명령어

The first ALL is the users allowed
The second one is the hosts
The third one is the user as you are running the command
The last one is the commands allowed

 

https://unix.stackexchange.com/questions/201858/what-does-all-all-all-all-mean-in-sudoers

 

What does "ALL ALL=(ALL) ALL" mean in sudoers?

If a server has the following in /etc/sudoers: Defaults targetpw ALL ALL=(ALL) ALL Then what does this mean? all the users can sudo to all the commands, only their password is needed?

unix.stackexchange.com

 

'OS & Shell > Linux' 카테고리의 다른 글

명령어  (0) 2013.09.03
[linux] iptables  (0) 2013.09.02
vi tab size 변경  (0) 2013.07.02
ls 용량 정렬  (0) 2013.06.27
ll alias  (0) 2013.06.27
Comments