You are not logged in.
Pages: 1
I've installed sudo but I can't use it on my user as I don't have the permissions to. I've looked it up on Google and found I had to do visudo in order to edit the file and allow myself to use sudo on my other user. But it wont let me edit anything. I've heard you need to press insert to edit, so I did that and it let me delete stuff sorta (backspace key doesn't work but pressing the delete key does). The problem is I can't actually type anything, when I try to I get graphical glitches and no text is entered.
Edit: nevermind; it suddenly started working (I literally didn't press anything, it just started co-operating after a few min).
Last edited by Zukaro (2012-11-28 23:32:54)
Offline
man sudoers
/etc/sudoers can be edited with any text editor.
Last edited by Scimmia (2012-11-28 23:32:33)
Offline
man sudoers
/etc/sudoers can be edited with any text editor.
The sudoers file said you have to use visudo otherwise you'll get errors, so I didn't try with that. Thanks anyways though (next time I'll just do it that way and see what happens).
Either way visudo started working so it's fine now. :3
Offline
So...
How are you liking the vi text editor so far?
Offline
Technically you can edit the sudoers file with any text editor - but it's a very bad idea to try to open it directly.
However, if you were following any of the appropriate wiki pages you would have seen
# EDITOR=nano visudoNormally we don't like to spoon-feed such information that is readily available in the wiki - but that one's a freebie, as I can rest assured that if you are not following the beginners guide you're sure to screw up your system in some other way.
Last edited by Trilby (2012-11-28 23:51:23)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
...
I am fairly sure that won't work unless you've configured /etc/sudoers to include the EDITOR environment:
# Use vim as editor
Defaults env_keep += "EDITOR VISUAL PAGER"(Note: I personally added the above)
Offline
It will. VISUAL and EDITOR are taken from the current environment by default.
This does depend on the compile time configuration of visudo - but the arch package includes this option. You cannot set EDITOR to *anything* and have it work. There is a finite list of accepted editors, I don't know what they all are, but nano is definitely on the list.
Last edited by Trilby (2012-11-29 00:20:10)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I know our sudo is compiled with --with-env-editor, however, this is the default sudoers file after building: http://ix.io/3wG
No where does it seems to allow the EDITIOR or VISUAL env and, although this was probably 2 years ago now, setting $EDITOR never worked for me. (At any rate, I'll take your word for it since it was a long time ago. Next time I tinker with a fresh sudoers, I'll try exporting vim.)
Last edited by Earnestly (2012-11-29 00:29:10)
Offline
@Kaustic, it works... I have been using vim with visudo since I installed this system... does yours not work? Or have you not tried it recently? (I noticed you said someting about 2 years ago...)
Offline
Yup, caveat emptor ![]()
PS: In a sort of ironic twist of fate, I don't mind using vi anymore, hence why I haven't tried alternatives with any new installations. I'll make a note of it for next time.
Last edited by Earnestly (2012-11-29 00:39:46)
Offline
Also works fine with vim set as EDITOR in the environment for me.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Pages: 1