I've just managed to setup OpenVPN properly on my server and test it to be properly working with client computers and I came to wonder how OpenVPN keys can be generated as clients come and go.
Is it necessary to rebuild the Diffie-Hellman .dh
file and recreate all previous client keys as I just need to add or remove a client?
Thanks
As Ency says, provided you've created your own CA, you simply create another key for the new user. Before any more gets typed, when you set up openVPN you did create your own CA, as recommended, didn't you?
Edit: OK, then
I also have some notes somewhere about making a CRL, which allows you to revoke old certificates, and pointing openVPN at the crl, but I can't immediately find them.
My solution is:
I have got my own Certificate Authority and anytime I need new client I just create another certificate. It is simple and I am pretty sure you can do same thing even with
easyRSA
delivered with openVPN.It is also more universal, because you can easily manage certificates for another services such as apache, etc.
Use duplicate-cn option and one key for all client or use easy-rsa for create user certification.
You can also tie the CN (that houses the user login name) of the user cert to a login that you can administer, for example, with FreeRADIUS. I wrote a small integration script couple of years ago. This way you can simply block user access by removing them from FreeRADIUS user list. The idea is that the certificate will protect the VPN from anyone else, and the FreeRADIUS login from the user itself (should the user's login need to be revoked). You can find the script and additional detail here.
Tested on OpenVPN 2.4.7 on Windows 7. I followed those steps:
vars.bat
.clean-all.bat
.clean-all.bat
.build-key A_New_Client
.It is assumed that
vars.bat
hasn't been changed since the last time, especially the key size part, as well as openssl-1.0.0.cnf is kept default.