Ubuntu - sudo 명령어에서 root 권한이 없을 떄
(... is not in the sudoers file. This incident will be reported.)
간혹 사용자 계정을 생성하고 sudo 명령어로 접근을 할 때 아래와 같은 에러가 발생하는 경우가 있다.
HOSTNAME is not in the sudoers file.  This incident will be reported.위 에러의 해결 방법을 알아보자
sudoers 파일 수정
우선, root로 접근하자 (root 접근 권한이 있는 다른 계정에서 해도 된다)
$ su -sudoers 파일에 계정이름이 들어가야 root 권한이 부여된다
sudoers 파일을 아래와 같이 수정하자
$ visudo /etc/sudoers
root ALL=(ALL:ALL) ALL
(username) ALL=(ALL:ALL) ALL(username) 안에는 당연히 자신의 계정 이름이 들어가야 한다.
예를 들어 내 계정 이름이 ncloud라면 다음과 같이 수정하면 된다
# /etc/sudoers
ncloud ALL=(ALL:ALL) ALL저장한 뒤, 다시 sudo 명령어를 사용하면 root 권한이 부여된 것을 확인할 수 있음!
