{"id":580,"date":"2025-03-26T20:20:51","date_gmt":"2025-03-26T23:20:51","guid":{"rendered":"https:\/\/difusao.tech\/blog\/?p=580"},"modified":"2025-03-26T20:20:52","modified_gmt":"2025-03-26T23:20:52","slug":"redefinindo-a-senha-do-usuario-root-no-wsl","status":"publish","type":"post","link":"https:\/\/difusao.tech\/blog\/redefinindo-a-senha-do-usuario-root-no-wsl\/","title":{"rendered":"Redefinindo a Senha do Usu\u00e1rio Root no WSL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Perdeu a senha do root na sua distro dentro do wsl?<\/h2>\n\n\n\n<p>Esquecer a senha do utilizador root no WSL pode ser um problema frustrante, mas felizmente, existem maneiras de redefinir e recuperar o acesso total ao seu sistema. Este guia completo ir\u00e1 mostrar-te como realizar este processo de forma simples e eficaz.<\/p>\n\n\n\n<p><strong>M\u00e9todo 1: Logando como Root pelo PowerShell e Redefinindo a Senha<\/strong><\/p>\n\n\n\n<p>Este \u00e9 o m\u00e9todo mais direto e recomendado para redefinir a senha do root no WSL.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Abra o PowerShell como administrador:<\/strong> Clique com o bot\u00e3o direito no menu Iniciar e selecione &#8220;Windows PowerShell (Administrador)&#8221;.<\/li>\n\n\n\n<li><strong>Liste as distribui\u00e7\u00f5es WSL instaladas:<\/strong> Digite o seguinte comando e pressione Enter:<code>wsl -l<br><\/code>Isto exibir\u00e1 uma lista das suas distribui\u00e7\u00f5es WSL. Anote o nome da distribui\u00e7\u00e3o que deseja aceder (exemplo: Ubuntu-20.04).<\/li>\n\n\n\n<li><strong>Logando como root na distribui\u00e7\u00e3o desejada:<\/strong>  Substitua <code>NomeDaDistribuicao<\/code> pelo nome da sua distribui\u00e7\u00e3o e execute o seguinte comando:<code>NomeDaDistribuicao confi --user-default root<br><\/code>Exemplo:<code>ubuntu-20.04 <code>confi --user-default root<\/code><\/code><\/li>\n\n\n\n<li><strong>Redefina a senha do usu\u00e1rio root:<\/strong> Digite o comando <code>passwd<\/code> root e pressione Enter. Ser\u00e1 solicitado que insira a nova senha e a confirme.<\/li>\n\n\n\n<li><strong>Feche o WSL:<\/strong> Digite <code>exit<\/code> e pressione Enter para sair do ambiente root.<\/li>\n<\/ol>\n\n\n\n<p>Segue imagem do procedimento:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"194\" src=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/03\/image-2.png\" alt=\"\" class=\"wp-image-581\" srcset=\"https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/03\/image-2.png 525w, https:\/\/difusao.tech\/blog\/wp-content\/uploads\/2025\/03\/image-2-300x111.png 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>At\u00e9 a pr\u00f3xima.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Perdeu a senha do root na sua distro dentro do wsl? Esquecer a senha do utilizador root no<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[239,272,275,273,274],"class_list":["post-580","post","type-post","status-publish","format-standard","hentry","category-aplicativos-gnu-linux","tag-passwd","tag-root","tag-senha-wsl-root","tag-wsl-pass","tag-wsl-root"],"_links":{"self":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":1,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions\/582"}],"wp:attachment":[{"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/difusao.tech\/blog\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}