Thursday, January 13, 2011

How to edit /etc/sudoers?

Hi Friends,

Well you must have come across various situations when you need to quickly edit the /etc/sudoers file for making changes.

Though it is not straight forward to open in an vi editor & edit it, below are time saving commands for Linux & Unix to quickly edit the same:

Linux:
bash-3.00$ sudo visudo

Unix:
bash-3.00$ /usr/local/bin/sudo /usr/local/sbin/visudo

VISUDO opens the /etc/sudoers file in a temporary editable mode, which can be changed and saved to reflect changes immediately.

Hope this tip helps :-)

Keywords:
Linux, Unix, Red Hat, Solaris, /etc/sudoers, vi, visduo, sudo, edit, etc

No comments: