Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm writing a PHP application and I want to be able to add new lists to mailman running on my ubuntu server. For one reason or another, mailman's newlist script requires root privileges. Is there any way that I can get newlist to not require sudo? Obviously I can't just circumvent sudo, but is there any possible way to get this working?

Thanks, Daniel

share|improve this question

I'm confused as to how you would think that sudo would be an obsticle. You could use specify that for the specific command, and specific userid that NO Password would be required:

  username   all = (root) NOPASSWD: specific-command

If a single, or limited number of commands is unavailable, then script the functionality you want and use that as a sudo command.

Your other alternative is to make the specific commands needed as suid as root. However, depending on the environment you are in could be a security risk.

share|improve this answer
I wasn't entirely sure how to word my question, and apparently I didn't do it well enough. So, what you're suggesting is to add an exception to the sudoers/visudo file? – Daniel Dreier Nov 1 '11 at 17:43

root privileges?

At least on Debian (which Ubuntu is based on) Mailman is running as list user and group by default, and when I manage lists from shell I'm logged in as list user.

I think adding your Apache user to list group should be enough.

For better security, you might also use something like suPHP and run your list management user as list user, and let other scripts to be run by some other user.

share|improve this answer
Ok, I'll give that a try! I suppose that as a test, I could add my user to the list group as well? – Daniel Dreier Nov 1 '11 at 17:51
Well, that is one way to test. – Janne Pikkarainen Nov 1 '11 at 18:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.