Results 1 to 5 of 5

Thread: Editing /etc/sudoers, don't want to mess up again.

  1. #1
    Join Date
    Oct 2010
    Beans
    203
    Distro
    Ubuntu 12.04 Precise Pangolin

    Editing /etc/sudoers, don't want to mess up again.

    I edited my /etc/sudoers file the other day to add timestamp_timeout=0 to cause sudo to ask for a password every time. I used visudo in sudo mode and when it came to saving it appeared to want to save the file as sudoers.tmp so I edited this to sudoers. Anyway some how may edit failed. I booted up into terminal and reedited and somehow lost all access to the sudo mode. I think the file ended up with the wrong permissions.

    After a fresh install I don't want to mess this up again. So please, please tell me how to save it. Should I save as sudoers.tmp or sudoers? I presume a could have made a typo, but am assuming not.

    Any help ideas would be greatly appreciated as I don't want to reinstall ubuntu and all the packages again.

    Thanks

  2. #2
    Join Date
    Mar 2010
    Location
    Scotland
    Beans
    258
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Editing /etc/sudoers, don't want to mess up again.

    You should be able to access the sudoers file from a live CD... If you break it, just boot from a live CD and fix it.
    [538] [792] Just because you have a secure OS doesn't mean you are invincible. Be careful out there! Don't trust strange sites and such. Also, don't block JavaScript, It is not some insecure monster who will attack you at every turn!

  3. #3
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Editing /etc/sudoers, don't want to mess up again.

    Just save it as the tmp file, visudo checks the validity of this file after you exit, and if it's invalid, gives you the option to modify it or abandon changes. If it's valid when you exit, visudo replaces the existing sudoers with the new one.
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  4. #4
    Join Date
    Oct 2010
    Beans
    203
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Editing /etc/sudoers, don't want to mess up again.

    Thanks all. File now edited and all Ok with the password prompt every time. Its also worked for the gksu command used when synaptic starts etc. Which was going to be my next job.

    Thanks again.

  5. #5
    Join Date
    Jun 2007
    Beans
    13,428

    Re: Editing /etc/sudoers, don't want to mess up again.

    If you have occasion down the road to go to natty then you'll find the sudo used now will not allow the timestamp except on the current open instance
    (so you'll have no need to edit sudoers, nor will any edit to have any effect in this regard

Tags for this Thread

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
  •