Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I installed ubuntu for the first time and I wanted my user to be an administrator so I followed some step by step that I found were
nano / etc / sudoers.
in the line that says #User privilege specification
root ALL = (All: ALL) All
leydi ALL = (All: ALL) All
save changes and then throw me this message
Error reading / etc / sudoers: permission denied
if I execute visudo it shows me visudo: / etc / sudoers: Permission denied
now it does not allow me to do anything, and I can not find the solution.
You need to boot into single user mode and restore that file (including permmissions).
I don't know what did you follow, but as you can see the result was not really good. Next time use visudo, nothing else (that will save you a lot of time).
Just FYI -- To boot into single user mode as pan64 suggests, reboot your computer. When the Grub page appears, immediately hit the down arrow key and select Advanced Options for Ubuntu. A menu of boot options should appear. Choose the recovery mode for the newest kernel. Then a new menu box should appear (if you have 18.04), one item of which should allow you to boot to a root level terminal. That should give you a text-only screen and terminal with full root permissions. All disks should be automatically mounted.
I installed ubuntu for the first time and I wanted my user to be an administrator so I followed some step by step that I found were
nano / etc / sudoers.
in the line that says #User privilege specification
root ALL = (All: ALL) All
leydi ALL = (All: ALL) All
save changes and then throw me this message
Error reading / etc / sudoers: permission denied
if I execute visudo it shows me visudo: / etc / sudoers: Permission denied
Did you run nano /etc/sudoers and visudo as root?
Quote:
now it does not allow me to do anything, and I can not find the solution.
what do you mean by anything? Do all commands you enter fail, or does sudo fail?
your user can become an administrator any time via the sudo command.
that means you need to enter your password.
this is a fundamental part of how linux works (compared to windows) - please do not change that.
##
## User privilege specification
##
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
I think putting users in a group 'wheel' or 'sudo' would be your best bet.
I don't remember ever having to mess about with visudo in Ubuntu, I think it "just werked". It's possible that OP put the cart before the horse and tried to do too much too soon. If he could revert his changes he may find sudo works to his liking.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.