Permission denied when launch python script via ba

2020-02-23 08:28发布

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

replace-md5sums.py has chmod 600

# ls -l ./scripts/replace-md5sums.py
-rw------- 1 ubuntu ubuntu 661 2011-04-27 16:30 ./scripts/replace-md5sums.py

10条回答
做个烂人
2楼-- · 2020-02-23 09:01

Do “chmod +x script”

Now try executing

查看更多
一纸荒年 Trace。
3楼-- · 2020-02-23 09:03

Check for id. It may have root permissions.

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

It works.

查看更多
We Are One
4楼-- · 2020-02-23 09:06

Try this

python ./scripts/replace-md5sums.py
查看更多
Rolldiameter
5楼-- · 2020-02-23 09:06
#strace ./scripts/replace-md5sums.py
查看更多
男人必须洒脱
6楼-- · 2020-02-23 09:12

Mount your Windows partition with "exec" option - on some distros it's "noexec" by default.

查看更多
手持菜刀,她持情操
7楼-- · 2020-02-23 09:13

You should be able to run the script typing:

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

There are times where the user you are currently logged with just don't have the permission to change file mode bits. In such cases if you have the root password you can change the file permission this way:

$ sudo chmod 755 ./scripts/replace-md5sums.py
查看更多
登录 后发表回答