서버 관리

[ubuntu/에러] - 사용자 sudo 오류 해결 (is not in the sudoers file. This incident will be reported)

uni2237 2023. 3. 9.
728x90
728x90

👻 에러

uni1 is not in the sudoers file. This incident will be reported

 

🤷‍♀️이유

사용자 계정이 root 권한이 없기 때문

 

* sudoers file :
Linux 및 Unix 시스템에서 슈퍼 유저 또는 root 권한을 가지지 않는 사용자가 특정 명령어 또는 명령어 그룹을
루트 권한으로 실행할 수 있도록 권한을 부여하는 파일

 

😃 해결 방법

 

💁‍♀️ 해결 방안 1)

사용자를 sudo 그룹에 추가

root 계정으로 이동 후 다음 명령 실행 (혹은 sudo 그룹 내 이용가능 계정으로 이동)
root@79c00c6b662a:/# usermod -aG sudo uni1 

# /etc/group 등록됐는지 확인 
root@79c00c6b662a:/# grep "sudo" /etc/group 
sudo:x:27:uni1 

# 사용자 계정으로 다시 접속 후 확인.(잘 됨) 
uni1@79c00c6b662a:~$ sudo chfn uni1 
Changing the user information for uni1 Enter the new value, or press 
	ENTER for the default Full Name []:

 

💁‍♀️ 해결 방안 2)

/etc/sudoers 파일을 열어서 직접추가 

root@79c00c6b662a:/# vi /etc/sudoers

vi /etc/sudoers

 

uni1 추가

 

728x90

댓글