Welcome to the Linux Foundation Forum!

Issue with lab1.1 !

Options

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.

Comments

  • stongench
    Options

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

  • coop
    coop Posts: 915
    Options

    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.

  • MelvynDrag
    MelvynDrag Posts: 20
    edited January 2021
    Options

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

Categories

Upcoming Training