Thanks but I keep getting the same answer. I ********did******* give
permission, as root, for anyone to run the script. I used chmod 755
scriptname, while logged in as root. Still, it wouldn't run from the web
page, but it would run from the command line. It just wouldn't run. Period.
Then, all I did -- one single thing -- was change ownership with chown to
the user who owned the home directory in which the script was located. So,
my question was, can root not give permission to run a script in a user's
home directory? I know the obivious answer is: sure! But, nevertheless, my
script would not run with permission from root. It just wouldn't, until I
changed ownership to the user. I can't explain it, which is why I'm asking.

Am i missing something here? If so, please tell me -- because there's
something going on that apparently no one knows the answer to. It seems
obivious and simple and basic, etc. But it's not.

Why do I keep getting answers like, "Change permission" ... "There's a
difference between permission and ownership" .... "Read about permissions,
it's all explained" ... I know I know !!!!!! :)

See past postings. I do know the difference between permissions and
ownership. Changing the permissions did nothing; changing the ownership did
-- which is _why_ I came here for some enlightenment. My question is: how
could changing the ownership of the file to a user would magically allow
the file to run, whereas having the file owned by root would not allow it
to run? The file is in the user's home directory.

Thanks for the help, but I give up :). No one seems to understand what I'm
asking. Oh well ... I know it doesn't make sense. That's why it's sooooooo
weird. How else can I explain it?

I guess it's just time to let this one die. After all, the script is
working now. Hooray!

mitch




                                                                                       
                                    
                    Pascal Goguey                                                      
                                    
                    <[EMAIL PROTECTED]        To:     [EMAIL PROTECTED]     
                                    
                    p>                           cc:                                   
                                    
                    Sent by:                     Subject:     Re: [newbie] Shell 
Script                                    
                    newbie-owner@linux-ma                                              
                                    
                    ndrake.com                                                         
                                    
                                                                                       
                                    
                                                                                       
                                    
                    01/07/02 08:18 PM                                                  
                                    
                    Please respond to                                                  
                                    
                    newbie                                                             
                                    
                                                                                       
                                    
                                                                                       
                                    




On 2002.01.07, at 23:36, [EMAIL PROTECTED] wrote:

> This brings up a question about permissions ...
>
> So a script (or any executable, such as a perl script written for cgi)
> cannot be run by anyone other than root, if it was created by root? I
> mean,
> root can't give permission for a root-owned script to be world
> executable,
> even if the administrator wanted to? While I can see how doing that
> would
> be a very bad idea, in terms of security, I'm just asking in order to
> learn
> more about linux file permissions.

No, you should not confuse permissions and ownership.
Ownership and permissions are independent. When
you run ls -al from the shell, you have the permission string
first and then the owner and the group.

As root, you can allow anybody to run anything. Suppose
your script is called rootownedscript, you can allow anybody to run
it by typing chmod o+x rootownedscript (o means other, x means
execute, therefore chmod o+x = make executable for other).
Well, if you read the manual (type man chmod from a terminal),
you will know everything about chmod.

But as a warning, be careful to what you allow to your users...
I wouldn't recommend to allow diskdrake or other funny tools to
be allowed to all users...

> I had written a perl cgi script, and it wouldn't run from the web page,
> as
> it turns out because I had created it as root.

Then chmod o+x your_script.

Pascal


Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com





Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to