Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My program needs to write in /var/log as well as /usr/lib including all the sub-folders in these directories.

How do I give permission for my program to do it?

share|improve this question
add comment

1 Answer

The only safe way of doing this would be to run your program as root. Any program that needs to write to system directories should be run as root anyway. A normal user has no business accessing those directories.

If your really, really want to make your system insecure you can look up SUID. Although, as explained here, you will have trouble setting SUID for scripts.

I really do not recommend this though. Seriously, just run your program as root. On a debian derived system (or any other that has sudo configured) do:

$ sudo your_program_name  

If sudo is not configured, do:

$ su
$ your_program_name 
share|improve this answer
add comment

Your Answer

 
discard

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.