|
@@ -4,7 +4,7 @@
|
4
|
4
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
5
|
5
|
<head>
|
6
|
6
|
<title></title>
|
7
|
|
-<!-- 2015-03-23 Mon 20:14 -->
|
|
7
|
+<!-- 2015-04-03 Fri 18:38 -->
|
8
|
8
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
9
|
9
|
<meta name="generator" content="Org-mode" />
|
10
|
10
|
<meta name="author" content="Bob Mottram" />
|
|
@@ -630,31 +630,19 @@ Once your email is validated then go to <b>Validations Wizard</b> and choose <b>
|
630
|
630
|
</p>
|
631
|
631
|
|
632
|
632
|
<p>
|
633
|
|
-Log into the Freedombone and become the root user. Now we can generate a new certificate request as follows.
|
|
633
|
+Log in to the Freedombone, become the root user, then issue the renew command:
|
634
|
634
|
</p>
|
635
|
635
|
|
636
|
636
|
<div class="org-src-container">
|
637
|
637
|
|
638
|
|
-<pre class="src src-bash"><span class="org-builtin">export</span> <span class="org-variable-name">HOSTNAME</span>=mydomainname.com
|
639
|
|
-openssl genrsa -out /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key 2048
|
640
|
|
-chown root:ssl-cert /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
|
641
|
|
-chmod 440 /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
|
642
|
|
-mkdir /etc/ssl/requests
|
643
|
|
-</pre>
|
644
|
|
-</div>
|
645
|
|
-
|
646
|
|
-<p>
|
647
|
|
-Now make a certificate request as follows. You should copy and paste the whole of this, not just line by line.
|
648
|
|
-</p>
|
649
|
|
-
|
650
|
|
-<div class="org-src-container">
|
651
|
|
-
|
652
|
|
-<pre class="src src-bash">openssl req -new -sha256 -key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key -out /etc/ssl/requests/$<span class="org-variable-name">HOSTNAME</span>.csr
|
|
638
|
+<pre class="src src-bash">ssh username@mydomainname -p 2222
|
|
639
|
+su
|
|
640
|
+freedombone-renew-cert -h mydomainname
|
653
|
641
|
</pre>
|
654
|
642
|
</div>
|
655
|
643
|
|
656
|
644
|
<p>
|
657
|
|
-For the email address it's a good idea to use postmaster@mydomainname.
|
|
645
|
+For the email address it's a good idea to use <i>postmaster@mydomainname</i>.
|
658
|
646
|
</p>
|
659
|
647
|
|
660
|
648
|
<p>
|
|
@@ -662,102 +650,34 @@ Use a random 20 character password, and keep a note of it. We'll remove this la
|
662
|
650
|
</p>
|
663
|
651
|
|
664
|
652
|
<p>
|
665
|
|
-View the request with:
|
|
653
|
+On the StartSSL site select <b>Certificates Wizard</b> then <b>Web server SSL/TLS Certificate</b>. You can then click on "skip" and then copy and paste the certificate request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
|
666
|
654
|
</p>
|
667
|
655
|
|
668
|
|
-<div class="org-src-container">
|
669
|
|
-
|
670
|
|
-<pre class="src src-bash">cat /etc/ssl/requests/$<span class="org-variable-name">HOSTNAME</span>.csr
|
671
|
|
-</pre>
|
672
|
|
-</div>
|
673
|
|
-
|
674
|
656
|
<p>
|
675
|
|
-On the StartSSL site select <b>Certificates Wizard</b> then <b>Web server SSL/TLS Certificate</b>. You can then click on "skip" and then copy and paste the encrypted request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
|
676
|
|
-</p>
|
677
|
|
-
|
678
|
|
-<p>
|
679
|
|
-Select <b>Tool Box</b> and then <b>Retrieve Certificate</b> from the list. Make sure to choose the one with the correct expiration date. Copy the text.
|
|
657
|
+Select <b>Tool Box</b> and then <b>Retrieve Certificate</b> from the list. Make sure to choose the one with the correct expiration date. Copy the text, then on the Freedombone.
|
680
|
658
|
</p>
|
681
|
659
|
|
682
|
660
|
<div class="org-src-container">
|
683
|
661
|
|
684
|
|
-<pre class="src src-bash">mv /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key
|
685
|
|
-editor /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.crt
|
|
662
|
+<pre class="src src-bash">editor /etc/ssl/certs/mydomainname.new.crt
|
686
|
663
|
</pre>
|
687
|
664
|
</div>
|
688
|
665
|
|
689
|
666
|
<p>
|
690
|
|
-Delete any existing contents then paste the public key from the StartSSL site. Save and exit. Then run the following commands:
|
|
667
|
+Paste the public key from the StartSSL site. Save and exit. Then run the renew command again:
|
691
|
668
|
</p>
|
692
|
669
|
|
693
|
670
|
<div class="org-src-container">
|
694
|
671
|
|
695
|
|
-<pre class="src src-bash">mkdir /etc/ssl/roots
|
696
|
|
-mkdir /etc/ssl/chains
|
697
|
|
-wget <span class="org-string">"http://www.startssl.com/certs/ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/roots/startssl-root.ca"</span>
|
698
|
|
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class1.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class1.server.ca.pem"</span>
|
699
|
|
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class2.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class2.server.ca.pem"</span>
|
700
|
|
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class3.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class3.server.ca.pem"</span>
|
701
|
|
-ln -s <span class="org-string">"/etc/ssl/roots/startssl-root.ca"</span> <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span>
|
702
|
|
-ln -s <span class="org-string">"/etc/ssl/chains/startssl-sub.class1.server.ca.pem"</span> <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span>
|
703
|
|
-cp <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt"</span> <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
|
704
|
|
-<span class="org-builtin">test</span> -e <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span> && cat <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span> >> <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
|
705
|
|
-<span class="org-builtin">test</span> -e <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span> && cat <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span> >> <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
|
|
672
|
+<pre class="src src-bash">freedombone-renew-cert -h mydomainname
|
706
|
673
|
</pre>
|
707
|
674
|
</div>
|
708
|
675
|
|
709
|
676
|
<p>
|
710
|
|
-Remove the certificate password, so if the server is rebooted then it won't wait indefinitely for a non-existant keyboard user to type in a password.
|
|
677
|
+The new certificate will then be installed.
|
711
|
678
|
</p>
|
712
|
|
-
|
713
|
|
-<div class="org-src-container">
|
714
|
|
-
|
715
|
|
-<pre class="src src-bash">openssl rsa -in /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key -out /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
|
716
|
|
-cp /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key
|
717
|
|
-shred -zu /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
|
718
|
|
-</pre>
|
719
|
|
-</div>
|
720
|
|
-
|
721
|
|
-<p>
|
722
|
|
-Create a bundled certificate which joins the certificate and chain file together.
|
723
|
|
-</p>
|
724
|
|
-
|
725
|
|
-<div class="org-src-container">
|
726
|
|
-
|
727
|
|
-<pre class="src src-bash">cat /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.crt /etc/ssl/chains/startssl-sub.class1.server.ca.pem > /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.bundle.crt
|
728
|
|
-</pre>
|
729
|
|
-</div>
|
730
|
|
-
|
731
|
|
-<p>
|
732
|
|
-And also add it to the overall bundle of certificates for the Freedombone. This will allow you to easily install the certificates onto other systems.
|
733
|
|
-</p>
|
734
|
|
-
|
735
|
|
-<div class="org-src-container">
|
736
|
|
-
|
737
|
|
-<pre class="src src-bash">cp /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.bundle.crt /etc/ssl/mycerts
|
738
|
|
-cat /etc/ssl/mycerts/*.crt > /etc/ssl/freedombone-bundle.crt
|
739
|
|
-tar -czvf /etc/ssl/freedombone-certs.tar.gz /etc/ssl/mycerts/*.crt
|
740
|
|
-</pre>
|
741
|
|
-</div>
|
742
|
|
-
|
743
|
|
-<p>
|
744
|
|
-To avoid any possibility of the certificates being accidentally overwritten by self-signed ones at a later date you can create backups.
|
745
|
|
-</p>
|
746
|
|
-
|
747
|
|
-<div class="org-src-container">
|
748
|
|
-
|
749
|
|
-<pre class="src src-bash">mkdir /etc/ssl/backups
|
750
|
|
-mkdir /etc/ssl/backups/certs
|
751
|
|
-mkdir /etc/ssl/backups/private
|
752
|
|
-cp /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>* /etc/ssl/backups/certs/
|
753
|
|
-cp /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>* /etc/ssl/backups/private/
|
754
|
|
-chmod -R 400 /etc/ssl/backups/certs/*
|
755
|
|
-chmod -R 400 /etc/ssl/backups/private/*
|
756
|
|
-</pre>
|
757
|
679
|
</div>
|
758
|
680
|
</div>
|
759
|
|
-</div>
|
760
|
|
-
|
761
|
681
|
<div id="outline-container-unnumbered-10" class="outline-2">
|
762
|
682
|
<h2 id="unnumbered-10">Why use self-signed certificates?</h2>
|
763
|
683
|
<div class="outline-text-2" id="text-unnumbered-10">
|