Permission denied when running python script through bash

# ./scripts/replace-md5sums.py bash: ./scripts/replace-md5sums.py: Permission denied 

replace-md5sums.py has chmod 777

 # ls -l ./scripts/replace-md5sums.py -rw------- 1 ubuntu ubuntu 661 2011-04-27 16:30 ./scripts/replace-md5sums.py 
+4
source share
8 answers

You can run script input:

 $ chmod 755 ./scripts/replace-md5sums.py $ ./scripts/replace-md5sums.py 

There are times when the user with whom you are currently registered is simply not allowed to change the bits of the file mode. In such cases, if you have a root password, you can change the file resolution in this way:

 $ sudo chmod 755 ./scripts/replace-md5sums.py 
+10
source

Mount your Windows partition using the "exec" option - by default some distributions are "noexec".

+7
source

I solved my problem. this is just the python version that the interpreter reads from the first line. deleting the version number did it for me, i.e.

 #!/usr/bin/python2.7 --> #!/usr/bin/python 
+2
source

Did you turn

 #!/usr/bin/python 

how is your first line?

+1
source

chmod 755 fileName

 #!/usr/bin/python2.7 -tt 
+1
source

Check ID. It may have root privileges.

So type su and then execute the script as ./scripts/replace-md5sums.py .

He works.

0
source

Make a "chmod + x script"

Now try to run

0
source
 #strace ./scripts/replace-md5sums.py 
-1
source

All Articles