LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-11-2010, 02:04 PM   #1
skaushal_lk
LQ Newbie
 
Registered: Jul 2010
Distribution: Ubuntu, CentOS
Posts: 27

Rep: Reputation: 4
sudoers file: syntax error


Dear All/Gurus,

Recently I edited sudoers file and did typing error. Now neither I can do sudo nor change it.
Code:
sudo visudo -c 
>>> sudoers file: syntax error, line 8 <<<
How I can get correct the sudoers file? Please help.

Thanks,
~SK
 
Old 07-11-2010, 04:03 PM   #2
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
I haven't experienced something like that, but try to copy the file to a new name, edit it manually with, i.e. vim, nano etc. Save the file, and replace the original. I think it should work
 
Old 07-11-2010, 05:21 PM   #3
skaushal_lk
LQ Newbie
 
Registered: Jul 2010
Distribution: Ubuntu, CentOS
Posts: 27

Original Poster
Rep: Reputation: 4
Hi Dinithion,

I can't do that either:
Code:
cp /etc/sudoers .
cp: cannot open `/etc/sudoers' for reading: Permission denied
 
Old 07-11-2010, 05:31 PM   #4
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
Don't you have the root-password?
 
Old 07-12-2010, 04:20 AM   #5
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
guess you have to use "sudo"
 
Old 07-12-2010, 04:24 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Just log in as root normally...??? sudo should never be the ONLY way to get root access. If all else fails you can just reboot to runlevel 1 and edit the file that way.
 
  


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
sudoers file error: owned by gid 10, should be 0 usafitz Linux - Newbie 8 12-01-2007 06:08 PM
Sudoers syntax clarification. uncle-c Linux - Newbie 3 11-11-2007 12:54 PM
Syntax error in sudoers file Julix Linux - General 9 09-07-2007 10:44 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 06:03 PM
sudo and sudoers syntax mikemrh9 Linux - Security 7 06-04-2005 08:54 PM


All times are GMT -5. The time now is 06:40 PM.

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