The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Testing sudo
Author: Dan 
Date:   09-10-07 19:08

Sometimes I want certain users to be able to use certain commands, via sudo without supplying a password. The /usr/local/etc/sudoers entry looks something like this:

bacula ALL=NOPASSWD:/home/dan/bin/dlt-write sa0

This command grabs the write stats from the DLT drive. But you need root privs for that. Hence the sudo.

Now, how can you test this from the command line? Like this:

su -m bacula -c /home/dan/bin/dlt-stats

Enjoy

--
Webmaster

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org