linux - 即使以 root 身份也无法执行 bash 脚本?

标签 linux bash centos permission-denied

我有一个奇怪的问题,我无法执行最基本的 bash 脚本:

#!/bin/bash
echo "me"

我将它保存为 test.sh 然后执行 chmod 755 test.sh 并运行 ./test.sh 得到:

bash: ./test.sh: Permission denied

知道是什么原因造成的吗?

最佳答案

如果您使用“noexec”选项挂载了文件系统,就会发生这种情况。你应该删除它。

关于linux - 即使以 root 身份也无法执行 bash 脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8095242/

相关文章:

linux - 如何使用 gawk/grep 打印特定的文本列表?例如我想打印txt文件中存在的所有颜色的名称

PHP file_exists 仅适用于 root :root

c++ - 如何用共享库替换可执行 C++ 程序的函数?

bash - 如何比较重复目录之间的文件大小匹配?

Bash 有条件地使用 sudo

python - 为什么 python shebang 不接受三个以上的参数?

php - 壳执行 |允许特定程序在 apache 用户下运行

centos - Chef chef-manage 没有出现在浏览器中?

c - 当某个进程打开文件时,unlink() 会做什么?

linux - 'ls' 命令在 Linux/Unix 中如何工作?