sudeoers file is usually located at
You need administrative privileges to edit this file. Editing it directly is strongly discouraged: you could irrevocably damage your system in case of syntax errors.
visudo tool is provided with the
sudo package for safe editing. It will automatically check file's consistency before saving and abort on syntax errors.
visudo invokes the text editor set in the EDITOR environment variable, or
vi otherwise. For instance, if you want to invoke Emacs instead:
$ EDITOR=emacs visudo
Once you have the editor fired up, you want to add the following line at the User privilege section:
test <host>=(ALL) /sbin/ifconfig
or, if you do not want to get prompted for a test's password
test <host>=(ALL) NOPASSWD: /sbin/ifconfig
You need to replace by your machine hostname, or 'ALL' if you want the privilege to apply on any machine.
See the man pages:
visudo(8) for the complete documentation.