当我在 Ubuntu 15.04 上安装 Tomcat 8 时,我使用以下命令创建用户“tomcat”:
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Tomcat Java Servlet and JSP engine' \
--group \
--disabled-password \
--home /home/tomcat \
tomcat
因此,我没有密码。现在我需要生成 CSR 以便在 Tomcat 8 上安装 SSL 证书。为此,我使用本教程。
运行命令时,keytool -genkey -alias tomcat -keyalg RSA -keystore <your_keystore_filename>
它会要求输入用户“tomcat”的密码。我尝试按 ENTER,但没有用。
我应该怎么办?
答案1
嗯,我不认为 keytool 命令会要求您输入 tomcat 用户的密码。生成自签名证书与系统用户无关。Keytool 命令要求您为正在生成的证书设置密码。
keytool -genkey -alias tomcat -keyalg RSA -keystore /applications/certs/test.key
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: example.com
What is the name of your organizational unit?
[Unknown]: test
What is the name of your organization?
[Unknown]: test
What is the name of your City or Locality?
[Unknown]: delhi
What is the name of your State or Province?
[Unknown]: delhi
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=example.com, OU=test, O=test, L=delhi, ST=delhi, C=IN correct?
[no]: yes
Enter key password for <tomcat>
(RETURN if same as keystore password):
Re-enter new password:
答案2
尝试openssl
命令行。您将找到许多用于创建自签名证书的指南。