Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 03-15-2005, 03:34 PM   #1
Registered: Jan 2005
Distribution: Slackware-10.1.0
Posts: 41

Rep: Reputation: 15
visudo and pico

Hi there,
I put that on my /root/.bashrc and /home/crud/.bashrc:

EDITOR=pico; export EDITOR
VISUAL=pico; export VISUAL

I do 'source /root/.bashrc', I run 'visudo', and it opens with vi How can I do to make it open with pico ?


Old 03-15-2005, 03:51 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
From the man page:
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 flag or the enveditor 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.
Old 03-16-2005, 04:20 AM   #3
Senior Member
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
you could also do

pico /etc/sudoers
Old 03-16-2005, 04:51 AM   #4
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
"However, if visudo is configured with the --with-enveditor flag or the enveditor Default variable is set in sudoers"

this is from sudo's slackbuild:
./configure --prefix=/usr --sbindir=/usr/sbin --with-getpass --with-C2
I don't think that sudo is compiled with --with-enveditor, if that is what the manpage is saying.

Anyway it would have a security hole. In linux there is no vi any more. We use vi-clones. In most distros vi is just a link to vim. In slackaware it's a link to elvis.
bash-3.00$ ls -l /usr/bin/vi
lrwxrwxrwx  1 root root 5 2005-03-16 12:34 /usr/bin/vi -> elvis
If you remove that link and link vi to pico, then visudo will open /etc/sudoers with pico:
cd /usr/bin
rm vi
ln -s pico vi
If you use pico as your default editor you may keep the link, but I would recommend you to learn vi. It's a really powerful editor

As far as i know slackware do not make use of .bashrc . What ever enviromental variables you want to add/edit, put them in .profile

Last edited by perfect_circle; 03-16-2005 at 05:31 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Visudo and exit acbenny Linux - General 7 05-05-2011 12:33 PM
Need help with visudo powadha Debian 2 12-19-2004 05:04 AM
Modifying sudo timeout via visudo jonr Linux - Security 1 08-25-2004 12:25 AM
visudo xviddivxoggmp3 Slackware 7 08-17-2004 08:19 PM
visudo: command not can I find it? mfries Linux - Newbie 2 04-11-2004 07:34 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:11 AM.

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