Using celery in a django app to run script with ro

2019-07-28 21:00发布

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.

0条回答
登录 后发表回答