Thursday, June 4, 2009

Tutorial: Solution for configuring OpenVPN on Ubuntu 9.0.4 with a pkcs12 key. .p12 #PKCS12

Configuring OpenVPN on Ubuntu if you've been given a .pkcs12 file is not a joyride (at least, as of Ubuntu 9.04). Currently, Ubuntu's network manager does not recognize #PKCS12.

This blog entry assumes your IT department has provided:

  • Your #PKCS12 file, possibly suffixed with .p12. E.g. "username.p12"
  • Your password for the VPN
  • An .ovpn file, which is a text file that contains your VPN configuration

So, here is what you need to do:

  • First, make sure you have the OpenVPN stuff installed:
    • Launch the package manager: System->Admin->Synaptic Pkg Mgr
    • Make sure you install (or have already) "openvpn" and "network-manager-openvpn"
    • Probably need to reboot at this point
  • Second, you will need to break the pkcs12 key you were given into three seperate files: .pem, .crt, .key
    • See this blog entry as the source of this next part
    • Open a terminal window and navigate to the folder where you download the .p12 file IT gave you
    • Execute the following commands, using the key password IT gave you whenever one is asked for
    • openssl pkcs12 -in username.p12 -out username.pem
    • openssl pkcs12 -in username.p12 -out username.crt -clcerts -nokeys
    • openssl pkcs12 -in username.p12 -out username.key -nocerts
  • Third, launch the VPN connection configurator in the network manager
    • Click on the 4-bars network icon in the upper right of your screen
  • Fourth, specify the following in the dialog
    • VPN Connections -> Import....
    • Find your .ovpn file
    • User Cert: (your .crt file)
    • CA Cert: (your .pem file)
    • Private Key: (your .key file)
    • Password: (that password IT gave you)
  • Finally, you should be ready to go
    • Click on old 4-bars, and choose your VPN.
    • Hope that it connects, cause otherwise I don't know what to tell you.

No comments:

Post a Comment