Category Archives: System Administration

Visudo – how user can have root access to some commands

As root run visudo command. Some examples:

# root and users in group wheel can run anything on any machine as any user
root        ALL = (ALL) ALL
%wheel        ALL = (ALL) ALL

# bob can run du as root
bob ALL=(root)     /usr/bin/du

# bob can run du as root, and is not prompted to input password
bob ALL=(root) NOPASSWD: /usr/bin/du

To run it bob just need to do:
sudo du
(If it runs just du, it is executed as bob not root)

PS: to run command as another user that is not root use: sudo -u USER CMD

A care to have when using a Load-Balancer

Amazon’s LB has a health-check feature that will try a GET call to the first vhost that you have on your instances. (alphabetically ordered)

So, if by a chance, the first vhost “aa.example.com.conf” isn’t replying properly to the LB’s GET, your LB will consider that instance off service, which means none of the other vhosts will be serving until you fix whatever is wrong with that first vhost, even if all the other vhosts are working perfectly.