Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What does visudo do that nano -w doesn't? I've never understood this properly.


Locks to only one editing user and confirms syntax is clean before saving. I'm not aware of nano enforcing correct sudoers syntax. Plus plenty of us don't like nano.

man visudo for more info.


visudo, like vipasswd or crontab -e and other commands, respect the EDITOR environmental variable, so you can edit these files with whatever editor you prefer, while maintaining their protections.


True. Provisioning a new test VM for me usually entails something like this: ssh in; visudo; wtf, this is nano! Boo!; ctrl-x; update-alternatives --config editor... :)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: