运行 jre keytool 导致 Permission Denied 错误
Running jre keytool results in the Permission Denied error
我有一个脚本运行命令:
/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
检查了目录和密钥工具的所有权限——都是可执行的。
我在 RHEL-7
很多发行版不允许从 /tmp 目录中执行文件。
要么将 jre 移出 /tmp(为什么它甚至在那里?)或通过以下方式使其可执行:
sudo mount -o remount,exec /tmp
我有一个脚本运行命令:
/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
检查了目录和密钥工具的所有权限——都是可执行的。
我在 RHEL-7
很多发行版不允许从 /tmp 目录中执行文件。
要么将 jre 移出 /tmp(为什么它甚至在那里?)或通过以下方式使其可执行:
sudo mount -o remount,exec /tmp