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.

I have a script that I need to run. It is kicking off a java program. When I run it as me, it seems to work fine. If I type "sudo myscript.sh" it does not run fine. In reality, I need to run it as "sudo -su otherguy myscript.sh"

So neither of the sudo versions work. I get errors from the java program that make me think there are permission problems - file not found, could not write, etc etc. So what can I do to figure out why it is losing permissions? The funny thing is, I made the entire directory structure wide open with chmod -fR 777 * to try to figure out if it would run at those otehr users, and I still get the same error.

share|improve this question
2  
Post the specific errors. –  Rob Wouters Jan 25 '12 at 22:35
    
Any chance NFS is involved in this? root usually has no permissions on NFS filesystems. –  Mika Fischer Jan 25 '12 at 22:41
add comment

1 Answer

It is difficult to be sure without seeing the specific errors or the source of the script involved, but especially with the "file not found" issue, it sounds like an environment issue to me.

Have you tried running the script as another user without using sudo? You may have something extra in your $PATH, etc. that is necessary, but that isn't currently set for other users.

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.