{"id":117,"date":"2018-08-11T11:31:53","date_gmt":"2018-08-11T09:31:53","guid":{"rendered":"https:\/\/vmoller.dk\/?p=117"},"modified":"2018-09-17T17:46:26","modified_gmt":"2018-09-17T15:46:26","slug":"lost-esxi-root-password","status":"publish","type":"post","link":"https:\/\/vmoller.dk\/index.php\/2018\/08\/11\/lost-esxi-root-password\/","title":{"rendered":"Lost ESXi root password"},"content":{"rendered":"<p>So, you find yourself in a situation where you have lost the root password for your ESXi host(s). Luckily there are multiple ways of resetting it \u2013 but the best method depends on the exact situation. Ill try to outline three different scenarios (of course, more exists) &#8211; maybe your are placed in a completely different scenario but maybe this post can help you anyway.<\/p>\n<p><!--more--><\/p>\n<h3>Scenario 1: The ESXi host is standalone or is not connected to the vCenter server at the moment.<\/h3>\n<p>This is the hard way. It will be necessary to boot of a \u201cLive Linux CD\/DVD\u201d &#8211; Ill not go in to details since you can find a nice guide on this here: <a href=\"https:\/\/www.altaro.com\/vmware\/reset-esxi-root-password\/\" target=\"_blank\" rel=\"noopener\">Link<\/a> \u2013 in this situation there will be downtime on the host(s) \u2013 hopefully you have redundancy.<\/p>\n<h3>Scenario 2: The ESXi host is connected to the vCenter server and you have VMware ESXi Enterprise Plus licenses<\/h3>\n<p>Since vCenter is connected to the ESXi host(s) it\u2019s possible to use its \u201cSuper Powers\u201d to reset the password and since you have Enterprise Plus licenses you can do that in a simple way with the feature \u201cHost Profile\u201d. You can find a nice guide on this, right here: <a href=\"http:\/\/www.vmwarearena.com\/reset-esxi-root-password-using-vmware-host-profiles\/\" target=\"_blank\" rel=\"noopener\">Link<\/a><br \/>\nSince applying host profiles requires the host to be in \u201cmaintenance mode\u201d you must have redundancy in place to avoid downtime on your VMs \u2013 if you don\u2019t have the resources available for doing this, then don\u2019t panic. Carry on to \u201cSituation 3\u201d<\/p>\n<h3>Scenario 3: The ESXi host is connected to the vCenter server and you are using standard licenses.<\/h3>\n<p>This method requires that you have PowerCli installed. When PowerCli is in place you connect to your vCenter server and then with a few lines of code, you ask vCenter to set the password for the root account on a specific ESXi host.<br \/>\nHere is the code (remember to change the hostname in the first line):<\/p>\n<blockquote><p>$esxihost = Get-VMHost &lt;hostname&gt;<br \/>\n$esxcli = Get-EsxCli -VMHost $esxihost<br \/>\n$esxcli.system.account.set($false,&#8221;root&#8221;,&#8221;NewPassword!&#8221;,&#8221;NewPassword!&#8221;)<\/p><\/blockquote>\n<div id=\"attachment_119\" style=\"width: 865px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-119\" class=\"wp-image-119 size-full\" src=\"https:\/\/vmoller.dk\/wp-content\/uploads\/2018\/08\/PowerCliResetPW.jpg\" alt=\"alt text\" width=\"855\" height=\"311\" srcset=\"https:\/\/vmoller.dk\/wp-content\/uploads\/2018\/08\/PowerCliResetPW.jpg 855w, https:\/\/vmoller.dk\/wp-content\/uploads\/2018\/08\/PowerCliResetPW-300x109.jpg 300w, https:\/\/vmoller.dk\/wp-content\/uploads\/2018\/08\/PowerCliResetPW-768x279.jpg 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><p id=\"caption-attachment-119\" class=\"wp-caption-text\">Resetting ESXi password with PowerCli<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>Your root ESXi password is now set to: NewPassword!<br \/>\nI like this method because is simple and can be done without interrupting the hosts and VMs.<br \/>\nRemember to check if you have any services that actually connects to ESXi hosts (like hardware monitoring etc.) with the \u201croot\u201d account \u2013 then you might have to update the password there as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, you find yourself in a situation where you have lost the root password for your ESXi host(s). Luckily there are multiple ways of resetting it \u2013 but the best method depends on the exact situation. Ill try to outline three different scenarios (of course, more exists) &#8211; maybe your are placed in a completely [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[20,25,11,7],"tags":[23,22,21,24,4],"class_list":["post-117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esxi","category-powercli","category-vcenter","category-vsphere","tag-esxi","tag-lost-password","tag-powercli","tag-vcenter","tag-vsphere"],"_links":{"self":[{"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":5,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/posts\/117\/revisions\/140"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/media\/123"}],"wp:attachment":[{"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmoller.dk\/index.php\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}