How to edit a file as root the right way

Suppose you need to edit a file that requires root privileges, like /etc/fstab . One way to do this is simply invoking your editor of choice with sudo : &#xA; sudo vim /etc/fstab&#xA; Running a command with sudo is equivalent to logging in as root and then running the desired command. That means the loaded configuration will be root &rsquo;s, not the user&rsquo;s. &#xA; A better way to do that is…