[tldr]: TIL: sudoedit
I never ever was a fan of sudo
because I like having my accounts properly and strictly separated. If I want to do root stuff, I become root using su -l
. (And in general I will continue handling it like this in the future.)
Since my distribution’s package build system has it as hard dependency, I have sudo
installed. It’s configured to never cache anything and always only ask for the root password, with no further “real” configuration. I am the only use on the system, so I don’t care about running tasks as different user (and if so, it’s the root account).
Defaults rootpw
Defaults timestamp_timeout=0
dirk ALL=(ALL) ALL
… this allows the package creation process to run properly. At a specific point I enter my root password and that’s fine. Under normal circumstances I just use su -l
.
But since I recently had to configure a lot of files outside my home directory I always had the problem of a fully unconfigured editor. No proper syntax highlighting, my key combinations, etc. all not present (I prefer leaving root
as unconfigured as possible).
Then I found sudoedit
.
It runs in my normal environment, with all my configuration but allows me to edit files outside my $HOME
. I can just replace nvim /etc/foo.bar
with sudoedit /etc/foo.bar
and enter the root password and then edit the file as if it was a file in my environment.
It sometimes worth leaving your comfort zone to explore new things.
//tagged: #JustLinuxThings #TIL #commandline #sudo #sudoedit #changes