Configure Sudo: no password for certain commands (nopasswd)

Sudo (Super User Do) is Linux console only utility allowing users to execute programs which require root rights without knowing root password. There are lots of topic why sudo rocks on the Web so here you can find a tip how to configure sudo in order to execute certain root right requiring programs without any passwords (it known as sudo nopasswd).

There are several ways to configure sudo in Linux regardless distribution you use. Its configuration file is located at /etc/sudoers and can be edited using any text editor like vi, nano, pico, gedit, mcedit whatever:

sudo vi /etc/sudoers
or
sudo visudo

So, in order to allow user named artemn to execute, say, ifconfig command and assign IP addresses, netmasks to interfaces, add the following line to /etc/sudoers:

artemn ALL = PASSWD: ALL, NOPASSWD: /sbin/ifconfig

Please notice if there is already line for artemn in sudoers file, just replace it with the new one.

 
 
» You might also be interested in the following articles:
Nokia E-series sync with Evolution via Bluetooth in Ubuntu
Create .deb or .rpm from .tar.gz with checkinstall
FAQ: How to install and configure MySQL cluster?
Change MAC address of network interface in Linux
Vmware Server at Ubuntu Feisty 7.04



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

0 Responses to “Configure Sudo: no password for certain commands (nopasswd)”


  1. No Comments

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
Linux HOWTOs, Tutorials & Projects with Adam Palmer | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››