Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: help on fixing sudoer

  1. #1
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb help on fixing sudoer

    hacking again and messed up how do i correct

    ay@ray-desktop:~$ sudo apt-get update && sudo apt-get dist-upgrade
    >>> /etc/sudoers: syntax error near line 25 <<<
    sudo: parse error in /etc/sudoers near line 25
    sudo: no valid sudoers sources found, quitting
    ray@ray-desktop:~$



    tks in advance

  2. #2
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb Re: help on fixing sudoer

    and again

    ray@ray-desktop:~$ sudo visudo
    >>> /etc/sudoers: syntax error near line 25 <<<
    sudo: parse error in /etc/sudoers near line 25
    sudo: no valid sudoers sources found, quitting
    ray@ray-desktop:~$

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: help on fixing sudoer

    Reboot in Recovery Mode and edit the file:
    http://psychocats.net/ubuntu/fixsudo

    The default file looks like this:
    Code:
    # /etc/sudoers
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the man page for details on how to write a sudoers file.
    #
    
    Defaults	env_reset
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    
    # User privilege specification
    root	ALL=(ALL) ALL
    
    # Uncomment to allow members of group sudo to not need a password
    # (Note that later entries override this, so you might need to move
    # it further down)
    #%sudo ALL=NOPASSWD: ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL

  4. #4
    Join Date
    Feb 2007
    Location
    England, UK
    Beans
    197
    Distro
    Ubuntu Development Release

    Re: help on fixing sudoer

    Your best option would probably be to boot from the live CD, mount your hard-disk partitions and then edit your troubled /etc/sudoers file using visudo.

    Using visudo will warn you of errors before saving. Don't save the file if there are errors - as you've seen it causing a bit of grief but, as long as you've physical access to the box it's not too big an issue.
    AMD Athlon 64 X2 4800+ / ASUS M2NPV-VM / Corsair 8GB PC2-6400 / 4.5TB RAID10-LVM / 3TB LVM - Ubuntu 11.04
    Asus Eee PC 1000HE - Crucial 2GB PC-6400 - Ubuntu 11.04

  5. #5
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb Re: help on fixing sudoer

    vir good idea will try that couldnt get what sisco said to work and he usually has good advise
    tks

  6. #6
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: help on fixing sudoer

    Quote Originally Posted by ViRMiN View Post
    Your best option would probably be to boot from the live CD, mount your hard-disk partitions and then edit your troubled /etc/sudoers file using visudo.

    Using visudo will warn you of errors before saving. Don't save the file if there are errors - as you've seen it causing a bit of grief but, as long as you've physical access to the box it's not too big an issue.
    Editing the file with visudo from a live cd or another linux distro is a little tricky. You have to chroot to the Ubuntu installation.

    assuming that the root partition is mounted under /media/ubuntu:
    Code:
    sudo chroot /media/ubuntu
    VISUAL=gedit visudo
    should do the trick.

    for a fully functional chroot environment you have to mount some virtual filesystems:
    Code:
    sudo mount -t sysfs none /media/ubuntu/sys
    sudo mount -t proc none /media/ubuntu/proc
    sudo mount --bind /dev/ /media/ubuntu/dev
    sudo mount --bind /dev/pts /media/ubuntu/dev/pts
    sudo mount -o bind /etc/resolv.conf /media/ubuntu/etc/resolv.conf
    sudo chroot /media/ubuntu
    VISUAL=nano visudo
    [/code]

  7. #7
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb Re: help on fixing sudoer

    okay guys getting there not bad for a 60 year old fart here is where i am at if you could advise me how to proceed would appreciate it


    ray@ray-desktop:~$ sudo apt-get update && sudo apt-get dist-upgrade
    sudo: /etc/sudoers is mode 0640, should be 0440
    Segmentation fault
    ray@ray-desktop:~$

  8. #8
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: help on fixing sudoer

    Quote Originally Posted by rburkartjo View Post
    okay guys getting there not bad for a 60 year old fart here is where i am at if you could advise me how to proceed would appreciate it


    ray@ray-desktop:~$ sudo apt-get update && sudo apt-get dist-upgrade
    sudo: /etc/sudoers is mode 0640, should be 0440
    Segmentation fault
    ray@ray-desktop:~$
    You have to set the correct permissions on the sudoers file(Case 3 in the psychocats tutorial)

    In the Recovery Mode run:
    Code:
    chmod 0440 /etc/sudoers

  9. #9
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb Re: help on fixing sudoer

    sisco tks will try now

  10. #10
    Join Date
    Dec 2007
    Location
    green bay, wi
    Beans
    1,974
    Distro
    Xubuntu Development Release

    Lightbulb Re: help on fixing sudoer

    no luck sisco any other ideas

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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