Help! Sudoers is locked and I can't get out/in - Mandriva

This is a discussion on Help! Sudoers is locked and I can't get out/in - Mandriva ; Hi, I tried to look at /etc/sudoers via visudo. That was a big mistake since I know nada about vi. I couldn't even figure how to get out vi. Anyway, somehow I got out and left sudoers locked. I deleted ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Help! Sudoers is locked and I can't get out/in

  1. Help! Sudoers is locked and I can't get out/in

    Hi,

    I tried to look at /etc/sudoers via visudo. That was a big mistake since I
    know nada about vi. I couldn't even figure how to get out vi.

    Anyway, somehow I got out and left sudoers locked.

    I deleted /etc/sudoers.tmp and gave root rw privileges to sudoers. Still
    visudo says sudoers is busy.

    What else do I have to do to unlock it?

    And... is there any other, more intuitive editor I can use and if so, how?


    Thanks,


    Frank

  2. Re: Help! Sudoers is locked and I can't get out/in

    On Thu, 21 Feb 2008 14:18:01 GMT, Frank Dreyfus wrote:
    > Hi,


    Hello.

    > I tried to look at /etc/sudoers via visudo. That was a big mistake since I
    > know nada about vi. I couldn't even figure how to get out vi.
    >
    > Anyway, somehow I got out and left sudoers locked.
    > What else do I have to do to unlock it?


    Sorry, no idea on unlocking that file.


    > And... is there any other, more intuitive editor I can use and if so, how?


    Doing a

    man sudo

    Would lead you to the snippet
    2. The editor specified by the VISUAL or EDITOR envi-
    ronment variables is run to edit the temporary
    files. If neither VISUAL nor EDITOR are set, the
    program listed in the editor sudoers variable is
    used.

    So, you could put the name of the editor you like to use in the
    environment variable EDITOR in your ~/bashrc file.

    An example
    export EDITOR=kwrite # editor to use on editing a file
    export VISUAL=emacs # editor to use on editing the command line

  3. Re: Help! Sudoers is locked and I can't get out/in

    Bit Twister wrote in
    news:slrnfrr35l.tol.BitTwister@wm80.home.test:

    > So, you could put the name of the editor you like to use in the
    > environment variable EDITOR in your ~/bashrc file.
    >
    > An example
    > export EDITOR=kwrite # editor to use on editing a file
    > export VISUAL=emacs # editor to use on editing the command line
    >
    >


    Thanks Bit,

    I'll give that a try AFTER I get the d***d file unlocked.

    Thanks,


    Frank

  4. Re: Help! Sudoers is locked and I can't get out/in

    Bit Twister wrote in
    news:slrnfrr35l.tol.BitTwister@wm80.home.test:

    > So, you could put the name of the editor you like to use in the
    > environment variable EDITOR in your ~/bashrc file.
    >
    > An example
    > export EDITOR=kwrite # editor to use on editing a file
    > export VISUAL=emacs # editor to use on editing the command line
    >
    >


    It worked!

    To unlock sudoers, I renamed the file, created a new empty sudoers,
    copied the contents of the old file to the new one.

    Everything worked.

    I can now edit the file with kwrite!

    Next step, figure out how to use sudo!!!

    It's got to be the most complex configuration I've yet to see.

    Is there a "Sudo Configuration for Dummy's" book? ;>)

    All I want to do is allow Apache run "dmraid -r" from a php script
    without having to enter a password.


    Thanks,

    Frank

  5. Re: Help! Sudoers is locked and I can't get out/in

    On Thu, 21 Feb 2008 15:43:46 GMT, Frank Dreyfus wrote:
    >
    > Next step, figure out how to use sudo!!!


    have you pointed your browser at
    /usr/share/doc/sudo/

  6. Re: Help! Sudoers is locked and I can't get out/in

    On 2008-02-21, Frank Dreyfus wrote:
    > Hi,
    >
    > I tried to look at /etc/sudoers via visudo. That was a big mistake since I
    > know nada about vi. I couldn't even figure how to get out vi.
    >
    > Anyway, somehow I got out and left sudoers locked.
    >
    > I deleted /etc/sudoers.tmp and gave root rw privileges to sudoers. Still
    > visudo says sudoers is busy.
    >
    > What else do I have to do to unlock it?
    >
    > And... is there any other, more intuitive editor I can use and if so, how?


    You could use the lsof and fuser commands to see whether
    there is a process that has /etc/sudoers open (or files with
    similar names). You could also do "ls -a /etc | grep sudo"
    to see if there is a lock file whose name starts with a dot.

    In the future, if you have the misfortune to find yourself
    in vi, there is a sequence that can usually rescue you and
    get you out:

    1) Press and release the ESC key. That will usually get
    you out of insert or overwrite mode if you ended up
    in that mode. If you aren't in insert or overwrite
    mode, it will just beep (blink) at you.

    2) Type ':' then 'q'. If no file changes have been
    made, that will usually get you out of vi.

    3) If step 2 caused vi to whine about unsaved changes,
    repeat steps 1 and 2, then type '!'(assuming you
    don't want to save any changes).

    Hope that helps.

    --
    Robert Riches
    spamtrap42@verizon.net
    (Yes, that is one of my email addresses.)

+ Reply to Thread