You are not logged in.
This certainly belongs in the n00bie corner, I readily admit. I realise exactly what I've done, I've learned my lesson, and promise to learn vi now. That said, PLEASE HELP!
1. I've gotten by just fine for years using only nano, like it, and, as implied above, never learned vi/vim(/visudo).
2. I'm trying to start using AUR (got by w/o it for years, also).
3. I installed sudo, and as was suggested, removed the root passwd. I pretty quickly decided I didn't like, and saw no real advantage to, having to enter my passwd constantly, SO...
4. I edited /etc/sudoers to (I thought) remove the requirement for a passwd. It seemed very straightforward. *I DID THIS USING NANO.*
5. I apparently screwed up step 4, above. Now, of course, I can't do ANYTHING requiring root access. I can't log in as root. I can't access sudo. I can't restore the root passwd. I can't pacman -R sudo. AFAICT, I'm hosed.
Is there any way out of this? Yes, I REALLY feel stupid. I'm in "man vi" while I wait for replies...promise.
grndrush
Last edited by grndrush (2008-03-27 06:59:23)
Offline
If I had absolutely no root access, I'd boot from the install CD, mount my root partition to /mnt, and put a working /etc/sudoers file back in place. Here's a very minimalistic one that should get you up and running:
root ALL=(ALL) ALL
YOUR_USER_NAME ALL=(ALL) PASSWD: ALL
Good luck.
Offline
I just edited the sudoers file with nano with no problems... but I only use it for two applications. YMMV.
Offline
Your suggestion sounds brilliant, peart. I'll report back. TIA VERY MUCH.
Offline
Thanks again, peart. It worked like a charm. I now feel silly I didn't think of that myself; I guess I freaked when I lost root access. OF COURSE the CD trumps root. D'oh!
Offline
LoL no probs. Now you can run "sudo passwd root" and forget all about it
Offline
That's the plan! Turns out I set the NEW line up properly, but when I went to comment out the original spec, I hit the "$" key instead of the "#", and my eyes aren't the best at 2 PM. At 2 AM, I probably shouldn't even be messing with such.
Thanks again.
Offline
use the -c switch.
man visudo
just don't close down nano until u have saved the edited file and run the visudo -c command in a terminal next time.
Last edited by jacko (2008-03-27 10:39:33)
Offline
Or make visudo use /usr/bin/nano:
From man visudo:
There is a hard-coded list of editors that visudo will use set at com‐
pile-time that may be overridden via the editor sudoers Default vari‐
able. This list defaults to the path to vi(1) on your system, as
determined by the configure script. Normally, visudo does not honor
the VISUAL or EDITOR environment variables unless they contain an edi‐
tor in the aforementioned editors list. However, if visudo is config‐
ured with the --with-enveditor flag or the env_editor Default variable
is set in sudoers, visudo will use any the editor defines by VISUAL or
EDITOR. Note that this can be a security hole since it allows the user
to execute any program they wish simply by setting VISUAL or EDITOR.
Search man sudoers for details about editor and env_editor
As for the recovery, note that once your root partition is mounted on /mnt you could also do chroot /mnt /bin/bash from the livecd and then passwd.
Last edited by lloeki (2008-03-27 15:06:14)
To know recursion, you must first know recursion.
Offline
Throw nano away forever and learn vim!
I wrote a nice Quick Start guide in the wiki here: http://wiki.archlinux.org/index.php/Vim … tart_guide
Now you have no excuses.
Offline
I can't remeber if nano is configured to do this with arch (i'm in ubuntu ATM) but you may do
EDITOR=nano visudo
Also, using vi for only basic editing, there is only a few things to memorize;
1. "i" to insert text, "esc" to go back to command mode.
2. in command mode, use ":" to insert a command, like "q!" to quit without saving and "wq" for write and quit.
"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."
SETH / Jane Roberts
Offline
Thanks to all. I'd found the EDITOR via 'man vi' and 'man visudo' (I really did go straight to them after my original post, as promised ).
Misfit, pelle.k: I've never liked modal editors, going back to the original days of word processing, but yes I do realise that the Linux community in general has a longstanding preference (I'm trying to avoid the word 'cult' here ) for vi/vim over pico/nano. nano has served MY needs just fine for years, but I guess it's time to jump on the bandwagon. Ditto with sudo vs su. su has worked for me just fine up to now, but then I live alone, my machine's behind a firewalled router, etc; security really isn't an issue for me and I've just taken the path of least resistance.
Next up: reading your Quick Start guide for vim, Misfit. Thanks again.
Offline
Throw nano away forever and learn vim!
I wrote a nice Quick Start guide in the wiki here: http://wiki.archlinux.org/index.php/Vim … tart_guide
Now you have no excuses.
Brilliant!
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline