1

I need to run some commands on my ubuntu box where my django project resides that requires root privileges, from within my django project. I'm using celery to fire off an asynch process, this process in turn calls shell commands that requires root privileges to succeed.

How can I do this without risking creating huge security holes?

PS! The shell commands I need to call are smbpasswd, edit /etc/samba/smb.conf and restart the samba service.

Manoj Govindan
  • 72,339
  • 21
  • 134
  • 141
Weholt
  • 1,889
  • 5
  • 22
  • 35
  • 1
    at least, maybe you should run celeryd as an unprivileged user and use sudo to give root access to a whitelist of commands? – asksol Sep 22 '10 at 20:01
  • Could you tell me how to give root access to a whitelist of commands? That sounds like at least a temp solution. Thanks!! :-) – Weholt Sep 23 '10 at 10:24
  • See the syntax of the /etc/sudoers file, probably some tutorial somewhere. – asksol Sep 23 '10 at 13:48
  • 1
    Great! :-) Found all the stuff I need here : http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch09_:_Linux_Users_and_Sudo#The_.2Fetc.2Fsudoers_File – Weholt Sep 24 '10 at 10:37

0 Answers0