LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-18-2018, 11:29 AM   #1
leydijo
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Rep: Reputation: Disabled
Perimission Denied sudoers


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.

Thank you
 
Old 11-18-2018, 01:31 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,841

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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).
 
1 members found this post helpful.
Old 11-18-2018, 02:37 PM   #3
flshope
Member
 
Registered: Jul 2009
Location: Tennessee (United States)
Distribution: Debian 11.6, Ubuntu 22.04.2, 18.04.6, Android 11
Posts: 236
Blog Entries: 44

Rep: Reputation: 80
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.
 
Old 11-19-2018, 01:40 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by leydijo View Post
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?
 
Old 11-20-2018, 03:09 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by leydijo View Post
I wanted my user to be an administrator
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.
 
1 members found this post helpful.
Old 11-20-2018, 07:11 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
should that not be all caps for the designation?
Code:
 ##
## 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.

Last edited by BW-userx; 11-20-2018 at 07:40 AM.
 
Old 11-20-2018, 07:49 AM   #7
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
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.

Failing that,

Code:
usermod -a -G sudo leydi
and reboot might work.
 
Old 11-20-2018, 08:16 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
leydi ALL = (All: ALL) All
The user you created when you installed Ubuntu is the "administrator". As stated to run commands as root you need to use the sudo command.

sudo visudo

You will be prompted for your users i.e leydi's password. Again your already the administrator so you do not need to edit the sudoers file.
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perimission Denied sudoers leydijo Linux - Newbie 4 11-18-2018 03:30 PM
[SOLVED] User not in sudoers: How to add user? Permtion Denied for sudoers file esgol Linux - Newbie 3 07-13-2012 07:44 AM
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
fstab - how to set rwx perimission to all user? lonecrow Linux - Newbie 6 08-19-2007 04:39 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration