본문 바로가기

IT/OS

[CentOS] <username> is not in the sudoers file. This incident will reported.

[razor1911@CentOS7 ~]$ sudo -s
[sudo] password for razor1911: 
razor1911 is not in the sudoers file.  This incident will be reported.

 

Step

[razor1911@CentOS7 ~]$ su - root
Password: 
[root@CentOS7 ~]# 
[root@CentOS7 ~]# echo 'razor1911 ALL=(ALL) ALL' >> /etc/sudoers
[root@CentOS7 ~]# su - razor1911
Last login: Sat Jan  7 23:34:14 PST 2023 on :0
[razor1911@CentOS7 ~]$ sudo -s
[sudo] password for razor1911: 
[root@CentOS7 razor1911]#