This command will set a passphrase for the server pem file for OpenVPN on Linux. I setup a VPN configuration on Ubuntu and forgot to set the passphrase. This is how I managed to set one.
[email protected]:~$ sudo openssl rsa -des3 -in server-key.pem -out server2.pem Enter pass phrase for server-key.pem: writing RSA key Enter PEM pass phrase: Verifying - Enter PEM pass phrase:
Then I overwrote the original server pem file in /etc/openvpn and restarted the service and all was good.
[email protected]:~$ sudo service openvpn restart * Stopping virtual private network daemon(s)... * Stopping VPN 'udp1194' [ OK ] * Starting virtual private network daemon(s)... * Autostarting VPN 'udp1194' Enter Private Key Password:
This means that you must enter the password every time that the service is restarted, but the security implications of this greatly outweigh any annoyance this would cause.