{"id":282,"date":"2016-12-14T22:56:09","date_gmt":"2016-12-14T20:56:09","guid":{"rendered":"http:\/\/itsimple.info\/?p=282"},"modified":"2019-06-27T21:56:27","modified_gmt":"2019-06-27T19:56:27","slug":"hyper-v-replication-with-certificate-authentication","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=282","title":{"rendered":"hyper-v replication with certificate Authentication"},"content":{"rendered":"<p>\u00a0<\/p>\n<p class=\"entry-title\">Hyper-V Replication base on Certificate Authentication have great advantage in terms of security, kerberos Authentication base usually put the replication server in the same Domain as the hyper-v host server, Meaning you can access the replication server and have full access with the credential of the domain. In bad scenario like the spreading of ransom virus and such, the replication server can get damaged including the files of the VM\u2019s and they can get encrypted as the VM\u2019s are off and the file are not locked by the hyper-visor. There for, If you treat the replication server as kind of DR or backup server, it is safer not to put the replication server as domain member but to keep it on Workgroup or on different domain.<\/p>\n<p class=\"entry-title\"><u><strong>How to create Hyper-v replication with certificate Authentication :<\/strong><\/u><\/p>\n<p class=\"entry-title\">First lets create a root self signed certificate. you will need the <a href=\"https:\/\/msdn.microsoft.com\/library\/windows\/desktop\/aa386968.aspx\" target=\"_blank\"><u>MakeCert<\/u><\/a> tool and you can download it from <a href=\"https:\/\/itsimple.info\/wp-content\/uploads\/2016\/12\/Makecert.rar\"><u>Here<\/u><\/a> .<\/p>\n<p class=\"entry-title\">Lets assume the host name is Hyper-v1 and the replication server name is Replica . create root certificate on Hyper-v1:<\/p>\n<pre class=\"entry-title\"><span style=\"font-family: Arial;\"><span style=\"color: #444444;\">makecert -pe -n CN=Primary<span style=\"font-family: Tahoma;\"><span style=\"font-size: 12pt; color: #000000;\">hyperv1<\/span><\/span>RootCA -ss root -sr LocalMachine -sky signature -r Primary<span style=\"font-family: Tahoma;\"><span style=\"font-size: 12pt; color: #000000;\">hyperv1<\/span><\/span>RootCA.cer<\/span><\/span><\/pre>\n<p class=\"entry-title\">Create certificate From the root with both server and client authentication (Enhance Key Usage=eku) and with 2 subject names hyper-v1 and Replica:<\/p>\n<pre class=\"entry-title\">makecert.exe -pe -n \"CN=Hyper-v1,CN=Replica\" -ss my -sr LocalMachine -sky exchange -eku \"1.3.6.1.5.5.7.3.1,1.3.6.1.5.5.7.3.2\" -in Primaryhyperv1RootCa -is root -ir LocalMachine -sp \"Microsoft RSA SChannel Cryptographic Provider\" -sy 12 hyper-v1.cer<\/pre>\n<p>The command will install the certificate in the Personal store of the machine and is saved as a file locally. The certificate can be used for both Client and Server authentication<\/p>\n<p class=\"entry-title\">Now, import the certificates (root and cert) to both servers so the certificate\u2019s will be on both servers !<\/p>\n<p class=\"entry-title\">First export the certificate with the private key from the server you running on<\/p>\n<p>The certificates can be viewed by running <strong>mmc ->File->Add\/Remove Snap in\u2026->Certificates->Add->\u201dComputer Account\u201d->Next->Finish->Ok<\/strong><\/p>\n<p>You will find the Personal certificate (with the machine names) and the Root certificate (<span style=\"font-family: Arial;\"><span style=\"color: #444444;\">Primary<span style=\"font-family: Tahoma;\"><span style=\"font-size: 12pt; color: #000000;\">hyperv1<\/span><\/span>RootCA<\/span><\/span>) in the highlighted folders:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/6052.clip_image002_3F00D933.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"clip_image002\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/4278.clip_image002_thumb_69DBCDF6.jpg\" alt=\"clip_image002\" width=\"248\" height=\"290\" border=\"0\" \/><\/a><\/p>\n<p><strong>Export the Hyper-v1 server certificate with the private key.<\/strong><\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/5707.image_18BAAD00.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/1464.image_thumb_63447B8B.png\" alt=\"image\" width=\"523\" height=\"257\" border=\"0\" \/><\/a><\/p>\n<table border=\"0\" width=\"591\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"251\"><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/5226.image38_105BF90B.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/6505.image38_thumb_022010CC.png\" alt=\"image\" width=\"367\" height=\"257\" border=\"0\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"entry-title\"><strong>Then import it to the Replica server :<\/strong><\/p>\n<p class=\"entry-title\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/50\/45\/metablogapi\/1200.image_thumb_4341FFB3.png\" alt=\"image\" width=\"483\" height=\"297\" border=\"0\" \/><\/p>\n<p class=\"entry-title\">By default, a certificate revocation check is mandatory and Self-Signed Certificates don\u2019t support Revocation checks. To work around it, modify the following registry key on Hyper-v1 and Replica servers. Make sure that the script create right key and the value is set to 1:<\/p>\n<pre class=\"entry-title\">reg add \u201cHKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Virtualization\\Replication\u201d \/v DisableCertRevocationCheck \/d 1 \/t REG_DWORD \/f<\/pre>\n<p class=\"entry-title\">By now you have the certificate installed on both Hyper-v server and you can select them when set the security<\/p>\n<p class=\"entry-title\"><img loading=\"lazy\" decoding=\"async\" class=\"\" title=\"Capture17\" src=\"https:\/\/nerddrivel.files.wordpress.com\/2016\/03\/capture171.png?w=359&h=304&crop=1\" alt=\"Capture17\" width=\"513\" height=\"434\" data-attachment-id=\"1278\" data-orig-file=\"https:\/\/nerddrivel.files.wordpress.com\/2016\/03\/capture171.png\" data-orig-size=\"682,577\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Capture17\" data-image-description=\"\" data-medium-file=\"https:\/\/nerddrivel.files.wordpress.com\/2016\/03\/capture171.png?w=300\" data-large-file=\"https:\/\/nerddrivel.files.wordpress.com\/2016\/03\/capture171.png?w=584\" data-original-width=\"359\" data-original-height=\"304\" \/><\/p>\n<p class=\"entry-title\">Good Luck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 Hyper-V Replication base on Certificate Authentication have great advantage in terms of security, kerberos Authentication base usually put the replication server in the same Domain as the hyper-v host server, Meaning you can access the replication server and have full access with the credential of the domain. In bad scenario like the spreading of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,18],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-hyper-v","category-virtualization"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}