How to execute a file with (---x--x--x) Permissions and I am not the owner?

Michael T. Richter ttmrichter at gmail.com
Sun Aug 6 04:15:31 UTC 2006


On Sun, 2006-06-08 at 00:10 -0400, Gregory PiƱero wrote:

> It's a python file and I tried running these two commands and get the
> following errors:
> 
> $ python backup_all.py >> log.txt
> python: can't open file
> '/home/chiefinnovator/backups_all_web/backup_all.py': [Errno 13]
> Permission denied
> 
> $ backup_all.py >> log.txt
> python: can't open file
> '/home/chiefinnovator/backups_all_web/backup_all.py': [Errno 13]
> Permission denied
> 
> Since this file has passwords in it, I wanted to make it execute-only.
>  Is that not possible?  I also set the owner to root if that matters.


The problem is, I think, that the interpreter itself has to open and
read in the files to execute them.  Executing a proper binary is done at
the OS level itself in the binary loader, so it doesn't require a
process to open a file, read it, etc.

So these Python scripts?  Have to be readable.  If you don't want them
readable, you should do something like compile them to bytecode and make
those files readable (after stripping all doc strings, etc.) which still
won't quite do what you want, but will be better than what you've got.

-- 
Michael T. Richter
Email: ttmrichter at gmail.com, mtr1966 at hotpop.com
MSN: ttmrichter at hotmail.com, mtr1966 at hotmail.com; YIM:
michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber:
mtr1966 at jabber.cn

"I would not flinch from sacrificing a million lives for India's
liberty!" --Mahatma Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060806/d912deb0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060806/d912deb0/attachment.sig>


More information about the ubuntu-users mailing list