Wednesday 3 July 2013

How to Authorize per host machines in sudo

Problem: You want to allow a user authorization privileges only on certain machines

Solution: First, define a list of machines:

/etc/sudoers
Host_Alias SAFE_HOSTS = banana, cherry, grapes

Let smith run a program as jones on these machines:
# smith SAFE_HOSTS = (jones) /usr/local/bin/mycommand

Let smith run all programs as jones on these machines:
# smith SAFE_HOSTS = (jones) ALL


No comments:

Post a Comment