LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-12-2011, 12:10 PM   #1
toonmariner
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
sudoers oooopsies


Hi peeps,

I was getting annoyed at the authentication request on installing new software - looked at sudoers and had NOPASSWD : ALL on admin and sudo so I stupidly removed the % at the start of each line.

I have tried entering via recovery mode as root to fix this problem but when editing via sudo visudo it states file system is read only and if I attempt to su root with my password I just get authentication failure.

bit stuck on what to try next and would dearly love to avoid booting from disc (mainly because I can't find my usb and don't want to wipe my install completely).

Any help would be very much appreciated.
 
Old 11-12-2011, 12:47 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946
If you can login as root, you can fix the problem by directly modifying the /etc/sudoers file. To get root login, you can always reboot to single-user or recovery mode.

visudo is not necessary in single-user mode. It is a wrapper around a normal editor (defined in EDITOR environment variable, defaults to some editor, usually vi), which makes sure the file is edited atomically; that all other processes see either the old contents, or the new contents, but never anything that combines the two. It is used to avoid race conditions and editing mishaps, but is in no way required.

Therefore, if you can login as root, you can then edit the sudoers file using your favourite editor, for example using nano (nano /etc/sudoers) or vi (vi /etc/sudoers).
 
Old 11-12-2011, 01:48 PM   #3
toonmariner
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
I have booted via recovery mode, option menu presents 'root - drop to root shell prompt'.

However using nano /etc/sudoers when I attempt to save edits it says file system is read-only!

is there a difference between single-user and recovery mode? if so how do you enter single-user mode as I have not attempted that...
 
Old 11-12-2011, 02:32 PM   #4
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946Reputation: 946
Quote:
Originally Posted by toonmariner View Post
I have booted via recovery mode, option menu presents 'root - drop to root shell prompt'.

However using nano /etc/sudoers when I attempt to save edits it says file system is read-only!
Ah, that just means your recovery mode mounts the root filesystem read-only. It is a good thing; it means no changes are done (can be done!) to the filesystem, unless you explicitly allow it. (If one of your disks crashes, it is better that the system does not attempt to do any fixes, or do any changes at all to the disk contents, before you have had the opportunity to safely copy (or try to copy) your files to some other storage media.)

Fortunately, you only need to run one command to switch from read-only file system to a normal one:
Code:
mount -o remount,rw /
 
1 members found this post helpful.
Old 11-12-2011, 03:02 PM   #5
toonmariner
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
THANK YOU!

I'd have your babies if I had the lady equipment...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Fedora /etc/sudoers file and sudoers.d directory davejjj Linux - Newbie 2 10-21-2011 06:19 PM
Help with sudoers DrStrangepork Linux - Newbie 8 10-13-2009 07:53 AM
sudoers madwac Linux - Newbie 1 03-10-2007 06:54 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
sudoers usa1234 Linux - General 1 10-24-2004 03:07 PM

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

All times are GMT -5. The time now is 01:03 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration