通过bash启动python脚本时权限被拒绝 [英] Permission denied when launch python script via bash

查看:616
本文介绍了通过bash启动python脚本时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

replace-md5sums.py具有chmod 600

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

推荐答案

您应该能够运行键入以下内容的脚本:

You should be able to run the script typing:

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

有时候,您当前登录的用户无权更改文件模式位.在这种情况下,如果您具有root密码,则可以通过以下方式更改文件许可权:

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

这篇关于通过bash启动python脚本时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆