LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

sudoedit

Safely edit files with elevated privileges

TLDR

Edit file as root
$ sudoedit [/etc/hosts]
copy
Edit with specific editor
$ SUDO_EDITOR=[vim] sudoedit [/etc/fstab]
copy
Edit multiple files
$ sudoedit [/etc/file1] [/etc/file2]
copy
Edit as another user
$ sudoedit -u [username] [file]
copy

SYNOPSIS

sudoedit [-u user] [options] files

DESCRIPTION

sudoedit safely edits files with elevated privileges. It's equivalent to sudo -e.File is copied to temp location. User edits with their own editor.After editing, changes copy back. Original file replaced atomically.User's environment is preserved. Editor runs as the user, not root.Safer than running editor as root. Limits privilege escalation risks.

PARAMETERS

-u, --user USER

Edit as user.
-g, --group GROUP
Edit with group.
-H
Set HOME.
-n, --non-interactive
Non-interactive mode.

ENVIRONMENT

SUDO_EDITOR - Preferred editorVISUAL - Visual editorEDITOR - Default editor

INSTALL

sudo apt install sudo
copy
sudo dnf install sudo
copy
sudo pacman -S sudo
copy
sudo apk add sudo
copy
sudo zypper install sudo
copy
nix profile install nixpkgs#sudo
copy

CAVEATS

Editor plugins run as user. Some editors may not work. Temp files briefly exist.

HISTORY

sudoedit is part of sudo, providing secure file editing. It prevents running arbitrary code with root privileges through editor extensions.

SEE ALSO

sudo(8), visudo(8), vi(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid