Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script in one of I my root directory: /root/scripts/

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

This made James 1 the owner of the script then I went to scripts directory and changed 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/

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 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
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

You must log in to answer this question.