I was trying to install VNC server on CentOS 6.5 when I ran into the error message, “John is not in sudoers file. This incident will be reported“. I’m somewhat new to CentOS and Linux in general. I know my way around but I’m not expert, yet. I found some instructions online but of course it was a command line.
I was running the following command at the Terminal to edit the sudoer file and got stuck.
When the editor appeared, I had a hard time navigating the file, saving and even exiting. My first attempt at editing the file failed. Then something odd happened each time I would try to re-open the sudoers file. I would receive an error message stating something about a swap file. Needless to say, it was driving me crazy.
Instead of editing the file using Terminal. I thought maybe I could just open the file like you would in Windows. That did it for me. It worked! I had to log off then sign back into the server as root to do it though.
Logged in as root, using the File Browser I navigated to File System then opened the etc folder. I found and double-clicked on the sudoers file. Then towards the bottom of the sudoers file I located the following line.
root ALL=(ALL) NO PASSWD: ALL
I changed it to:
%admin ALL=(ALL) NO PASSWD: ALL
then clicked Save.
The %admin stands for the admin group. If you do not have an admin group, simply create one. Go to System > Administration > Users and Groups. Click on Add Group, name it admin. Next add yourself to the admin group.
You may receive an error message saying the sudoers file is in Read Only mode. If this happens to you, go back to the File Browser and right click on the sudoers file. Select Properties then click on the Permissions tab. Under the sections labeled Owner and Group, change Read Only to Read and Write.
Now, my standard user account has greater administrative privileges. I feel spoiled, I must be a real computer nerd.
In the end, I was able to get a VNC server installed and working in CentOS 6.5 that automatically starts up on boot up. WHAT, WHAT!!
If you have questions about editing your sudoers file in CentOS, please leave them below. I’ll try my best to help you out.