Welcome to the Linux Foundation Forum!

Issue with lab1.1 !

The visudo command on my digital ocean debian 10 server doesn't respect the VISUAL and EDITOR environment variables from my /home/student/.bashrc.

I also added export VISUAL=vim to the root .bashrc, for root it works. when I use visudo as root it uses vim. When I use visudo as 'student', it does not read vim from the .bashrc file. Instead it uses the default 'joe' editor.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • For debian and Ubuntu use: sudo update-alternatives --config editor

  • Posts: 916

    In general, environment variables are not passed through sudo. Keep in mind you can probably just do something like EDITOR=vim sudo visudo ... . There may be something you can configure in /etc/sudoers as well. I'm not sure if the fact it is Digital Ocean matters as cloud setups can be idiosyncratic as well.

  • Posts: 20
    edited January 2021

    Thanks for the help folks will have to experiment with different computers to see whats idiosyncratic and whats not

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training