Server/Linux

특정 유저로 sudo명령어가 안될때 (XXX is not in the sudoers file.)

범데이 2021. 12. 22. 01:10

아래와같이 sudoers file에 유저가 존재하지 않는다고 뜰 때

postgres@VirtualBox:/home/user$ sudo date
postgres is not in the sudoers file.  This incident will be reported.

 

 

root유저로 혹은 sudo권한이 되는 유저를 통해 루트 권한으로 /etc/sudoers 파일을 열어준다.

vi /etc/sudoers

 

 

그 후, 파일 하단에 아래 구문과 같이 사용자를 추가해준 후, 저장한다.

postgres ALL=(ALL)  ALL

 

이후 sudo 명령어가 잘 먹는 모습이다.

postgres@VirtualBox:/home/user$ sudo date
Tue Dec 21 15:52:42 UTC 2021
반응형