LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2009, 03:42 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Rep: Reputation: Disabled
can I edit sudoers without vi?


I need to add myself to the sudoers file, but don't know how to use vi yet (the file says it must be edited in vi as root). Until I learn, is there another way?
 
Old 08-09-2009, 03:51 PM   #2
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Bullseye
Posts: 1,508

Rep: Reputation: Disabled
How about trying kate for Kde or gedit for Gnome?.
I believe both use a gui.
 
Old 08-09-2009, 03:58 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Yes you can. Man visudo gives, the second paragraph):
Quote:
There is a hard-coded list of editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default variable. 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 editor in the aforementioned editors list. However, if visudo is configured with the --with-enveditor option 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.
Try this command as your user and as root:
Code:
EDITOR=/path/to/nano visudo
 
Old 08-09-2009, 06:19 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I've always added myself to the sudoers file with a kdesu kate /etc/sudoers command on Fedora. As far as I can tell, Fedora will let you use any editor you want to use, but -- as noted by XavierP -- that may be distribution specific.

Note that, on some distributions (e.g., *ununtu ones), the system installer is automatically added to the sudoers file.
 
Old 08-10-2009, 01:35 PM   #5
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
You can open /etc/sudoers file using any text editor. Unfortunately in such case visudo doesn't report possible errors.

I discussed sudo usage for a few times. Here's nice explanation of it: http://www.linuxquestions.org/questi...ml#post3623333.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to edit "sudoers" file using visudo maniac matt Linux - Newbie 11 06-22-2013 08:38 AM
Edit sudoers by script snowman81 Programming 5 05-27-2008 06:52 PM
cannot edit /etc/sudoers unisol Ubuntu 13 06-18-2006 09:35 AM
visudo lets me edit sudoers but not save ver 3.3.1 suguru MEPIS 4 12-19-2005 06:23 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration