将证书导入cacerts时的权限错误 [英] Permission error when importing certificate to cacerts

查看:207
本文介绍了将证书导入cacerts时的权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将一些maven存储库的证书导入到全局密钥库中。
证书文件名为maven.crt,因此我运行的命令是

I need to import a certificate for some maven repositories into the global keystore. The certificate file is named maven.crt so the command I am running is

keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt

它问我密码然后如果我信任我回答的证书是
这是最终输出

It asks me for password and then if I trust the certificate to which I answer yes This is the final output

Certificate was added to keystore
keytool error: java.io.FileNotFoundException: /usr/java/jdk1.7.0_40/bin/java/jre/lib/security/cacerts (Not a directory)

我以root身份运行此命令,所以我不知道为什么我在这里收到权限错误。

I ran this command as root so I don't know why I am receiving permissions error here.

推荐答案

你的路径错了。 cacerts文件位于jdk_directory / jre / lib / security。

Your path is wrong. cacerts file is in jdk_directory/jre/lib/security.

请改为尝试:

keytool -import -keystore /usr/java/jdk1.7.0_40/jre/lib/security/cacerts -trustcacerts -alias maven -file maven.crt

这篇关于将证书导入cacerts时的权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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