我有一个运行命令的脚本:
/tmp/jre1.8.0_131/bin/keytool -import -trustcacerts -file '/etc/pki/ca-trust/source/anchors/company.crt' -keystore '/tmp/jre1.8.0_131/lib/security/cacerts' -storepass changeit
得到错误:
bash: /tmp/jre1.8.0_131/bin/keytool: Permission denied
检查了目录和keytool的所有权限-所有权限都是可执行的。
我在RHEL-7上
答案 0 :(得分:1)
许多发行版不允许在 / tmp 目录中执行文件。
要么将jre移出 / tmp (为什么甚至在其中?),也可以通过以下方式将其执行:
sudo mount -o remount,exec / tmp