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 in one of I my root directory: /root/scripts/script1.sh

I wan't to call that script as another user (james1).

I did the following (as root user):

root@pc83$ CD scripts
root@pc83$ chown -R james1:user scripts
root@pc83$ CD scripts
root@pc83$ chmods 755 script1.sh

This made James 1 the owner of the script then I went to scripts directory and changed script1.sh permission to 755 which lets other execute.

Still when I connect as james1s and try to run script1. I can't.

james1@pc83$ /root/scripts/script.sh

I get permission denied error. Could some please let me know where I am going wrong? thanks.

I am using Oracle Enterprise Linux but tried to replicate the same problem in Ubuntu 10.10 and had the same issue.

share|improve this question

migrated from stackoverflow.com Jan 17 '12 at 3:14

This question came from our site for professional and enthusiast programmers.

    
"Root directory" usually means / and not /root. –  tripleee Jan 16 '12 at 10:38
add comment

1 Answer

up vote 1 down vote accepted

Does james1 have permission to execute the root folder? That's needed for directly accessing files under /root/.

share|improve this answer
    
Hi Graham, you mean chown the root folder? –  user1063304 Jan 16 '12 at 10:25
    
no, you just need to chmod. Whatever field applies to james1 (probably group or other) needs the +x bit. –  user135 Jan 16 '12 at 10:34
    
No, he means does the current permission allow "other" to "execute"? Anyhow, put the script someplace like /usr/local/bin instead so you won't have to fiddle with permissions for /root - there's a reason they are somewhat tight. –  tripleee Jan 16 '12 at 10:37
    
@tripleee Not sure what Graham meant by the +x but it gave me an idea which I tried and worked. "$ chmod +x root" and then "$chmod 755 dummies -R" doing that I can now run scripts. Looks like all in between directories (in my case root and script) has to have o+x as well. –  user1063304 Jan 16 '12 at 13:14
    
@GrahamLee thanks for your help. –  user1063304 Jan 16 '12 at 13:15
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.