Skip to main content
Reword it to clarify the difference in privilege levels.
Source Link
Stephen Kitt
  • 481.4k
  • 60
  • 1.2k
  • 1.4k

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files. sudo -e also prevents users from running anything else as root (since most editors can start shells).

Basically, with sudo -e, you have a small set of operations done as root (with a number of checks to avoid root escapes), and everything the user interacts with to actually edit the file runs as the user. With sudo vim, everything happens as root, and the user can effectively do anything they want as root.

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files. sudo -e also prevents users from running anything else as root (since most editors can start shells).

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files. sudo -e also prevents users from running anything else as root (since most editors can start shells).

Basically, with sudo -e, you have a small set of operations done as root (with a number of checks to avoid root escapes), and everything the user interacts with to actually edit the file runs as the user. With sudo vim, everything happens as root, and the user can effectively do anything they want as root.

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

Mention root escapes, thanks Jörg W Mittag.
Source Link
Stephen Kitt
  • 481.4k
  • 60
  • 1.2k
  • 1.4k

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files. sudo -e also prevents users from running anything else as root (since most editors can start shells).

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files.

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files. sudo -e also prevents users from running anything else as root (since most editors can start shells).

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

Source Link
Stephen Kitt
  • 481.4k
  • 60
  • 1.2k
  • 1.4k

There’s one key difference: with sudo -e, the editor runs as your user, not as root; with sudo vim, the editor runs as root. This has a number of consequences; one of them is that with sudo -e, you’ll get your own editor setup; another is that with sudo -e, you won’t risk making other changes to root-owned files.

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?