user17085185
user17085185

Reputation:

Solution for Linux "permission denied"

I am pretty new to the Ubuntu environment and I have a question regarding the solution to "permission denied" error.

When I am trying to run the following command that executes a shell script and writes the result into a txt file, I get the permission denied error.

./test_image.sh > testCase.txt

I know that I can just sudo run the command, but I am hoping to do this command through a Java program and was wondering if there would be a way to give permission to any user that is trying to run this command.

Thank you in advance!!

Upvotes: 0

Views: 2243

Answers (1)

macosmi
macosmi

Reputation: 165

Why do you have permission deny error? Maybe you need to give your script rights to execute (eg. chmod +x test_image.sh) or give the user rights to write/change testCase.txt in a given directory. I am afraid you need to learn a bit about standard permissions or even ACLs, Selinux policy, setuid, sticky bits, etc.

Upvotes: 2

Related Questions