3 ms·
that's why I like to use `sudo sudo su' ;) And of course, `sudo vim', :!bash
by jonhohle 13y ago
that's why I like to use `sudo sudo su' ;) And of course, `sudo vim', :!bash
- eru 13y agoOn a more serious note, you should (almost) never do `sudo vim', but stick to `sudoedit'.
- onedev 13y agoI'm curious; what's the reasoning behind this?
- aegiso 13y agosudo vim means vim gets root privileges. Meaning vim can do anything it wants if it's bugged or somehow compromised. Not likely on an otherwie secure system but not impossible. sudoedit (according to the manpage) makes a copy of the file first, lets your editor edit it, then copies back when you're done -- so even a compromised editor couldn't do much damage beyond corrupting the given file.
- onedev 13y agoThat's awesome I never knew that; thanks so much for explaining it!