Find the answer to your Linux question:
Results 1 to 7 of 7
hi, i was trying to turn off the password needed to log in to my account in ubuntu, and i was looking on the internet for ways to do that. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    14

    i did something stupid with sudo!!


    hi, i was trying to turn off the password needed to log in to my account in ubuntu, and i was looking on the internet for ways to do that. i read an article which was about turning off passwords. It suggested the following:

    1. Open the terminal window from Applications --> accessories --> terminal, run the command:

    Code:
     sudo visudo
    2. Find the line that says

    Code:
    %admin ALL=(ALL) ALL
    3. and change it to

    Code:
    %admin ALL=(ALL) NOPASSWD: ALL
    4. Save and exit the file.

    After doing it i got the error message:

    Code:
    >>> /etc/sudoers: syntax error near line 25 <<<
    sudo: parse error in /etc/sudoers near line 25
    sudo: no valid sudoers sources found, quitting
    my password hasn't been turned off, and now i can't use sudo in the terminal. i can't figure it out at all and i dont know how to access that file again to change it back.

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Weird. The point of using visudo is that it should prevent you from saving with syntax errors.

    You should be able to boot into recovery mode and fix the file.
    Fix Broken Sudo

  3. #3
    Linux User
    Join Date
    Dec 2009
    Posts
    264
    Theres also the possibility to log in as root and change the line back.

  4. #4
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Quote Originally Posted by zombykillah View Post
    Theres also the possibility to log in as root and change the line back.
    Ubuntu has the true root account disabled by default.

  5. #5
    Just Joined!
    Join Date
    Sep 2009
    Posts
    14
    Quote Originally Posted by reed9 View Post
    You should be able to boot into recovery mode and fix the file.
    I followed the link and tried as you suggested, but in recovery mode as well i get the same message.

    Code:
    >>> /etc/sudoers: syntax error near line 25 <<<
    sudo: parse error in /etc/sudoers near line 25
    sudo: no valid sudoers sources found, quitting

  6. #6
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Do you have the live CD or live USB avaiable?

    You should be able to boot into the live CD, mount your root partition, find the file, and fix it or copy the default from the live CD.

  7. #7
    Just Joined!
    Join Date
    Sep 2009
    Posts
    14
    Quote Originally Posted by reed9 View Post
    You should be able to boot into the live CD, mount your root partition, find the file, and fix it or copy the default from the live CD.
    I have the live CD, but i'm not sure how to mount my root partition. is it command line based, or gui?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •