Using celery in a django app to run a script using root priviliges?

I need to run some commands in my ubuntu box where my django project, which requires root privileges, from my django project is located. I use celery to run an asynchronous process, this process, in turn, invokes shell commands that require root privileges to succeed.

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

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

+1
source share

Source: https://habr.com/ru/post/889718/


All Articles