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

Notices


Reply
  Search this Thread
Old 03-15-2005, 03:34 PM   #1
crud
Member
 
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 ?

Greets,

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

Rep: Reputation: 66
From the man page:
Quote:
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
heema
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
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
"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:
Code:
FLAGS="$SLKCFLAGS" \
./configure --prefix=/usr --sbindir=/usr/sbin --with-getpass --with-C2
make
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.
Code:
bash-3.00$ ls -l /usr/bin/vi
lrwxrwxrwx  1 root root 5 2005-03-16 12:34 /usr/bin/vi -> elvis
bash-3.00$
If you remove that link and link vi to pico, then visudo will open /etc/sudoers with pico:
Code:
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

*EDIT*
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.
 
  


Reply


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 fund....how can I find it? mfries Linux - Newbie 2 04-11-2004 07:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration