Difference between revisions of "Template:Preparing easyrsa"

From Teltonika Networks Wiki
Line 2: Line 2:
  
 
<ul>
 
<ul>
     <li>Now we can start preparing to generate certificates and keys. For this we'll be using the '''EasyRSA''' application that was installed along with OpenVPN. <br> EasyRSA commands have to be executed via the Windows Command Prompt. It can be opened by typing '''cmd''' in the Windows search bar ('''Windows button + S'''). When you launch it, make sure you run it '''as administrator''':
+
     <li>Now we can start preparing to generate certificates and keys. For this we'll be using the <b>EasyRSA 3</b> application that was installed along with OpenVPN.<br>EasyRSA commands have to be executed via the Windows Command Prompt. It can be opened by typing <i>cmd</i> in the Windows search bar (<i>Windows button + S</i>). When you launch it, make sure you <b>run it as administrator</b>:<br>[[File:How to generate tls certificates windows part 1 v3.png]]
        <ul>[[File:How to generate tls certificates windows part 1 v3.png]]</ul>
 
    </li>
 
    <li>Change the current directory to the EasyRSA folder. To do so, execute this command:
 
        <ul>
 
            <pre>cd "C:\Program Files\OpenVPN\easy-rsa"</pre>
 
        </ul>
 
    </li>
 
    <li>Before you can start, you must first initialize a directory for the Public Key Infrastructure (PKI). This can be done with the following command:
 
        <ul>
 
            <pre>.\easyrsa init-pki</pre>
 
        </ul>
 
    </li>
 
    <li>Open the '''''vars.bat''''' file with the Notepad text editor:
 
        <ul>
 
            <pre>notepad vars.bat</pre>
 
        </ul>
 
 
     </li>
 
     </li>
 +
    <li>Change the current directory to the EasyRSA folder. To do so, execute this command:<pre>cd "C:\Program Files\OpenVPN\easy-rsa"</pre></li>
 +
    <li>Launch EasyRSA:<pre>EasyRSA-Start.bat</pre></li>
 +
    <li>Before you can generate files with EasyRSA, you must first initialize a directory for the Public Key Infrastructure (PKI). This can be done with the following command:<pre>.\easyrsa init-pki</pre></li>
 +
    <li>Open the <i>vars.bat</i> file with the Notepad text editor:<pre>notepad vars.bat</pre></li>
 
     <li>This is the template file for generating certificates, i.e., the information stored here will be offered as default values during certificate generation. Locate and edit the following lines in accordance with your needs:
 
     <li>This is the template file for generating certificates, i.e., the information stored here will be offered as default values during certificate generation. Locate and edit the following lines in accordance with your needs:
         <ul>
+
         <pre>set KEY_COUNTRY=US
            <pre>set KEY_COUNTRY=US
 
 
set KEY_PROVINCE=CA
 
set KEY_PROVINCE=CA
 
set KEY_CITY=SanFrancisco
 
set KEY_CITY=SanFrancisco
 
set KEY_ORG=OpenVPN
 
set KEY_ORG=OpenVPN
  
        </ul>
 
    </li>
 
    <li>You can also set the key size for the Diffie Hellman parameters:
 
        <ul>
 
            <pre>set DH_KEY_SIZE=2048</pre>
 
        </ul>
 
 
     </li>
 
     </li>
     <li>Once you're done, save the file and close the editor</li>
+
    <li>You can also set the key size for the Diffie Hellman parameters:<pre>set DH_KEY_SIZE=2048</pre></li>
 +
     <li>Once you're done, save the file and close the editor.</li>
 
     <li>Run the following commands:
 
     <li>Run the following commands:
 
         <ul>
 
         <ul>

Revision as of 12:25, 29 October 2020

Step 2: preparing EasyRSA

  • Now we can start preparing to generate certificates and keys. For this we'll be using the EasyRSA 3 application that was installed along with OpenVPN.
    EasyRSA commands have to be executed via the Windows Command Prompt. It can be opened by typing cmd in the Windows search bar (Windows button + S). When you launch it, make sure you run it as administrator:
    How to generate tls certificates windows part 1 v3.png
  • Change the current directory to the EasyRSA folder. To do so, execute this command:
    cd "C:\Program Files\OpenVPN\easy-rsa"
  • Launch EasyRSA:
    EasyRSA-Start.bat
  • Before you can generate files with EasyRSA, you must first initialize a directory for the Public Key Infrastructure (PKI). This can be done with the following command:
    .\easyrsa init-pki
  • Open the vars.bat file with the Notepad text editor:
    notepad vars.bat
  • This is the template file for generating certificates, i.e., the information stored here will be offered as default values during certificate generation. Locate and edit the following lines in accordance with your needs:
    set KEY_COUNTRY=US
    set KEY_PROVINCE=CA
    set KEY_CITY=SanFrancisco
    set KEY_ORG=OpenVPN
    set [email protected]
  • You can also set the key size for the Diffie Hellman parameters:
    set DH_KEY_SIZE=2048
  • Once you're done, save the file and close the editor.
  • Run the following commands:
      vars
      clean-all