Quantcast
Channel: `sudo visudo /etc/hosts` gives syntax errors - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Answer by Artur Meinild for `sudo visudo /etc/hosts` gives syntax errors

$
0
0

visudo is a command designed to edit the /etc/sudoers file (and only that file), and perform an integrity check that ensures the file is valid.

If you give it a file as an argument, it will look for another sudoers file, and check that syntax. Since /etc/hosts is a different file with another syntax, this gives errors.

Just edit /etc/hosts with your favorite editor, like this:

sudo vim /etc/hosts

Or you can use the sudoedit (or sudo -e) command, which works the same way as running crontab -e (where you edit a temporary file that are copied to the destination when you're done):

sudoedit /etc/hosts

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>