๐ YSK : Do not use 'sudo vim/nano/emacs..' to edit a file. Instead, set your $EDITOR and use sudoedit or sudo -e.
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
TL;DR: title. It's to avoid exposing your system to vulnerabilities in your editor.
Hello all! Today, I want to adress one of my pet peeves : people using sudo
to run their editors as root. This is bad because of two things :
- It leaves your system vulnerable to any exploits involving your editor. You may also be prone to user errors.
- But worst of all, it makes it so your editor ignores its configuration ! Your carefully crafted
.vimrc
, your beautiful.emacs
config, all ignored !
Instead, set your $EDITOR
environment variable, and use either sudoedit file
or sudo -e file
.
Thanks for reading.
[link] [comments] ...