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
Re: Help! Sudoers is locked and I can't get out/in
On Thu, 21 Feb 2008 14:18:01 GMT, Frank Dreyfus wrote:[color=blue]
> Hi,[/color]
Hello.
[color=blue]
> 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?[/color]
Sorry, no idea on unlocking that file.
[color=blue]
> And... is there any other, more intuitive editor I can use and if so, how?[/color]
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
Re: Help! Sudoers is locked and I can't get out/in
Bit Twister <BitTwister@mouse-potato.com> wrote in
news:slrnfrr35l.tol.BitTwister@wm80.home.test:
[color=blue]
> 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
>
>[/color]
Thanks Bit,
I'll give that a try AFTER I get the d***d file unlocked.
Thanks,
Frank
Re: Help! Sudoers is locked and I can't get out/in
Bit Twister <BitTwister@mouse-potato.com> wrote in
news:slrnfrr35l.tol.BitTwister@wm80.home.test:
[color=blue]
> 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
>
>[/color]
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
Re: Help! Sudoers is locked and I can't get out/in
On Thu, 21 Feb 2008 15:43:46 GMT, Frank Dreyfus wrote:[color=blue]
>
> Next step, figure out how to use sudo!!![/color]
have you pointed your browser at
/usr/share/doc/sudo/
Re: Help! Sudoers is locked and I can't get out/in
On 2008-02-21, Frank Dreyfus <fdreyfus@nyw.com> wrote:[color=blue]
> 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?[/color]
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
[email]spamtrap42@verizon.net[/email]
(Yes, that is one of my email addresses.)