sudoer 추가하기

특정 사용자에게 권한을 위임하기 위해서는 /etc/sudoers 파일을 수정해야합니다.

root@teamlog:/# ls -al /etc/sudoers
-r--r----- 1 root root 774 1월 4 17:57 /etc/sudoers
root@teamlog:~# chmod 660 /etc/sudoers
root@teamlog:~# vi /etc/sudoers

파일 권한이 440이여서 읽기만 가능하기 때문에 읽고 쓸수 있게 660으로 바꿔서 작업을 하겠습니다.

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

루트 권한을 주고 싶은 일반 유저 아이디를 밑에 같은 형식으로 적어주시면 됩니다.

root@teamlog:~# chmod 440 /etc/sudoers

설정이 끝나시면 권한을 초기 권한으로 바꿔주시면 됩니다.

wyun13043@teamlog:~$ sudo cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of

일반 사용자가 루트 권한을 획득하였습니다.

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다

Comment moderation is enabled. Your comment may take some time to appear.