Linux/Fedora Core
Fedora Core 6에서 sudo를 설정하자 (How to setup sudo/sudoers on FC6)
구차니
2010. 3. 24. 15:34
sudo는 일시적으로 권한을 상승시켜 특정 프로그램을 실행하는 명령어이다.
그런데, FC6에서는 기본적으로 sudo를 사용하지 않고 있어서 추가를 해주어야 한다.
/etc/sudoers 는 설정파일로
이 부분만 추가되어있다.
이 줄을 복사해서 root 대신 사용자 아이디를 넣어주면, 그 사용자는 모든 명령어에 대해 sudo로 실행할수 있게 된다.
예를 들어 dev라는 사용자를 추가하려면
를 추가해주면 된다.
하지만, 이렇게만 하면 아래와 같은 문구가 나타난다.(lecture)
이녀석을 매번 보기 싫다면
이 녀석을 한줄 추가해주면
ubuntu 처럼 깔끔하게
요렇게만 물어본다.
원래대로라면 직접 /etc/sudoers를 vi로 수정하지 말고
visudo 라는 vi를 이용하여 안전하게 수정을 해야 하지만, FC6에서는 없는듯 하다.
[링크 : http://www.mjmwired.net/resources/mjm-fedora-fc6.html]
[링크 : http://ubuntuforums.org/archive/index.php/t-483591.html]
그런데, FC6에서는 기본적으로 sudo를 사용하지 않고 있어서 추가를 해주어야 한다.
/etc/sudoers 는 설정파일로
## Next comes the main part: which users can run what software on ## which machines (the sudoers file can be shared between multiple ## systems). ## Syntax: ## ## user MACHINE=COMMANDS ## ## The COMMANDS section may have other options added to it. ## ## Allow root to run any commands anywhere root ALL=(ALL) ALL |
이 줄을 복사해서 root 대신 사용자 아이디를 넣어주면, 그 사용자는 모든 명령어에 대해 sudo로 실행할수 있게 된다.
예를 들어 dev라는 사용자를 추가하려면
dev ALL=(ALL) ALL |
하지만, 이렇게만 하면 아래와 같은 문구가 나타난다.(lecture)
$ sudo ls We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: |
이녀석을 매번 보기 싫다면
Defaults lecture = never |
ubuntu 처럼 깔끔하게
$ sudo ls Password: |
원래대로라면 직접 /etc/sudoers를 vi로 수정하지 말고
visudo 라는 vi를 이용하여 안전하게 수정을 해야 하지만, FC6에서는 없는듯 하다.
lecture This option controls when a short lecture will be printed along with the password prompt. It has the following possible values: never Never lecture the user. once Only lecture the user the first time they run sudo. always Always lecture the user. If no value is specified, a value of once is implied. Negating the option results in a value of never being used. The default value is once. lecture_file Path to a file containing an alternate sudo lecture that will be used in place of the standard lec- ture if the named file exists. [링크 : http://linux.die.net/man/5/sudoers] |
[링크 : http://www.mjmwired.net/resources/mjm-fedora-fc6.html]
[링크 : http://ubuntuforums.org/archive/index.php/t-483591.html]