You are not logged in.
Pages: 1
hi to all
i put in my .bashrc some exported variables, like:
export EDITOR='nano'
but if i run
sudo visudo
, exported editor is ignored !!!
why ?, how can i solve this ?
thanks
Last edited by nTia89 (2011-03-05 18:03:17)
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Shouldn't it be:
export EDITOR=nano
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
yes, yes .... a mistake in the post, not in my .bashrc
edited the first post
Last edited by nTia89 (2011-03-05 15:02:07)
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be
overridden via the editor sudoers Default variable. This list defaults to "/usr/bin/vi". 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-env-editor 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.
Offline
yes but if i explitly run
sudo EDITOR=nano visudo
it works ......
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Maybe create an alias:
alias visudo="sudo EDITOR=nano visudo"
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
For security reasons environment variables that you define as non-root user are ignored when you sudo. If you want to keep certain environment variables when sudo-ing you need to name them in /etc/sudoers on the line with 'env_keep'. See man sudo.
Last edited by rwd (2011-03-05 17:41:29)
Offline
Maybe create an alias:
alias visudo="sudo EDITOR=nano visudo"
+1
Edit: See rwd's post.
Last edited by karol (2011-03-05 17:29:31)
Offline
For security reasons environment variables that you define as non-root user are ignored when you sudo. If you want to keep certain environment variables when sudo-ing you need to name them in /etc/sudoers on the line with 'env_keep'. See man sudo.
thanks, this is the answer
+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome
Offline
Pages: 1