[CentOS] Unable to execute a script , Permission denied

Jakub Jedelsky jakub.jedelsky at gmail.com
Tue May 25 13:03:33 UTC 2010


On 25.5.2010 14:57, Jatin Davey wrote:
> On 5/25/2010 6:20 PM, Jakub Jedelsky wrote:
>> On 25.5.2010 14:27, Jatin Davey wrote:
>>> Hi
>>>
>>> I have a linux box which has CentOS running in it. I logged into the box 
>>> using root and wrote a script in the /home/proc_threads directory. saved 
>>> the file and quit. I changed the file permissions such that any user 
>>> could execute it using the "chmod 777 filename" command.
>>>
>>> When i log out and log in as a non-root user i was not able to execute 
>>> the script though.
>>>
>>> Could some one please help in this regard. I am a newbie to linux.
>>>
>>> Thanks
>>> Jatin
>>> _______________________________________________
>>> CentOS mailing list
>>> CentOS at centos.org
>>> http://lists.centos.org/mailman/listinfo/centos
>>>   
>>
>> Hi,
>>
>> have another users access to /home/proc_threads directory? :) Don't
>> you call any functions from script which can be executed only by root..?
>> Send us the exact error which you get after execute your script as an
>> user.. If it is a bash script, you can debug it with "-x" option..
>>
>> Excuse my english :)
>>
>> Jakub J.
>>
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>   
> Here is the script that i am trying to execute as a non-root user:
>
> #!/bin/sh
> ps -C java -o thcount > /home/proc_threads/tempfile
> awk ' { total += $1 } END { print total } ' /home/proc_threads/tempfile
>
> here is the output when i try to execute as a non-root user:
>
> ./javathreads: line 2: /home/proc_threads/tempfile: Permission denied
> awk: cmd. line:1: fatal: cannot open file
> `/home/proc_threads/tempfile' for reading (Permission denied)
>
> Thanks
> Jatin
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>   

...and what are permissions of /home/proc_threads/tempfile? It seems,
that users can't write to it.. Try 'chmod o+w /home/proc_threads/tempfile'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20100525/ef6fe8bb/attachment.html>


More information about the CentOS mailing list