Bypass password for SSL at apache boot up or automate it?


I am using a Red Hat linux and I am hosting a website using SSL. When I created the key, I enabled the password protection. However, when I restart apache, its asking me the password. I would usually doesn't mind, however, we need to reboot sometime apache by a script and it doesn't restart because of this. Also, if I reboot the server, I need to go and start apache with the password. Is there a way to bypass this or make that kind of thing auto?

Who is Participating?

How can I get rid of the pass-phrase dialog at Apache startup time?

The reason this dialog pops up at startup and every re-start is that the RSA private key inside your server.key file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution!

   1. Remove the encryption from the RSA private key (while keeping a backup copy of the original file):

      $ cp server.key
      $ openssl rsa -in -out server.key

   2. Make sure the server.key file is only readable by root:

      $ chmod 400 server.key

Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root).

As an alternative approach you can use the ``SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.