I am running Ubuntu 12.04 on my laptop using VMware Player. I am not sure why but I have an account called "User Account" in addition to my account that I usually login to use Ubuntu. Well that was just a side comment but basically all I am trying to do is install the ncurses library on Ubuntu. I have tried installing ncurses using the following command lines:
sudo apt-get install libncurses5-dev
sudo apt-get install ncurses-devWhen I tried installing ncurses twice using the above commands I received the following prompt in the terminal:
[sudo] password for fsolano:where fsolano is my username,
so if you like the above line can be expressed more generically as
[sudo] password for username:
When I type in my password I receive the following message:
fsolano is not in the sudoers file. This incident will be reported.or more generically,
username is not in the sudoers file. This incident will be reported.
So far I have tried enabling the root user ("Super User") account by following the instructions at this link:
Here are some of the things the link suggested to do:
Allow another user to run
sudo. Type the following in the command line:sudo adduser username sudo
lLogging in as another user. Type the following in the command line:
sudo -i -u username
Enabling the root account. Type the following in the command line:
sudo -ior
sudo passwd root
I have tried all of the above command lines and after typing in each command I was prompted for my password. After I entered my password I received the same message as when I tried to install ncurses:
fsolano is not in the sudoers file. This incident will be reported.If anyone can help I would greatly appreciate it.
34 Answers
Can any of your users run sudo successfully? You'll need to log in as one of them, then run the sudo adduser username sudo for the username's you want to be able to run sudo.
Or, if none of your users can run sudo, you could boot into "Recovery mode" from grub (hold shift while booting, if your grub menu doesn't show up automatically, or adding single to the linux ... initrd ... quiet splash line), then:
mount -o rw,remount /
adduser username sudoRunning adduser for each user you want to be able to sudo. Then exit & resume. [From instructions linkd at the bottom of your help link, ]
There are other solutions if you can't get to Recovery mode, maybe with a live dvd & creative mounting & chroot, or editing files by hand. And if your sudoers files (/etc/sudoers*) are messed up that's something else that can be fixed from the psychocats.net link too. Like editing your hard drive's /etc/sudoers file to include a line that lets fsolano use sudo, like:
fsolano ALL=(ALL:ALL) ALL 2 Open a terminal and type this command
# pkexec visudoEnter the root password
Edd the following line to sudoers file
after this line
root ALL=(ALL) ALLadd this line
username ALL=(ALL)ALL
This worked for me. Then try to log in as root and type this command
# sudo -sEnter the root password and go on.
1This issue is simple there is no entry for fsolano in /etc/sudoers file.
May be with root user, execute following command : visudo
Above command will open the file for editing then give permissions to fsolano for executing sudo command.
2This worked like a charm in Redhat for me:
su
cd /etc
ls -l
chmod +w sudoersgedit sudoersScroll down in file and find line (root ALL=(ALL) ALL)
Right there add this for the user (example userid: roman)
root ALL=(ALL) ALL
roman ALL=(ALL) ALLExit & Save
chmod -w sudoers # (make the sudoers READ-ONLY again) 1