When I installed Tomcat 8 on my Ubuntu 15.04 I used the following command to create the user "tomcat":

sudo adduser \
  --system \
  --shell /bin/bash \
  --gecos 'Tomcat Java Servlet and JSP engine' \
  --group \
  --disabled-password \
  --home /home/tomcat \

As a consequence, I don't have a password. Now I need to generate a CSR in order to install the SSL certificate on Tomcat 8. For that I am using this tutorial.

While running command keytool -genkey -alias tomcat -keyalg RSA -keystore <your_keystore_filename> it requests a password for user 'tomcat'. I tried hitting ENTER but it doesn't work.

What should I do?


Well I don't think that keytool command is asking you the password for tomcat user. Generating a self-signed certificate has nothing to do with the system user. Keytool command ask you to set the password for the certificate you are generating.

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: 

Try the openssl commandline. You will find a lot of howtos for creating self signed certificates.

  • With Tomcat keytool is the way to go. – raupach Feb 11 '16 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.