http://wiki.nosdigitais.teia.org.br/index.php?title=Ssh_-_trocando_senha_da_chave&feed=atom&action=history
Ssh - trocando senha da chave - Histórico de revisão
2024-03-28T14:55:59Z
Histórico de revisões para esta página neste wiki
MediaWiki 1.39.0
http://wiki.nosdigitais.teia.org.br/index.php?title=Ssh_-_trocando_senha_da_chave&diff=34742&oldid=prev
Felipecabral em 19h52min de 30 de setembro de 2015
2015-09-30T19:52:32Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="pt-BR">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Edição anterior</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Edição das 16h52min de 30 de setembro de 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Linha 1:</td>
<td colspan="2" class="diff-lineno">Linha 1:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Muitas vezes criamos chaves criptográficas assimétricas com o OpenSSL e com o OpenSSH. No momento da criação de tais chaves, são solicitadas senhas para as mesmas. A dúvida é a seguinte: como proceder para trocar tais senhas?</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Muitas vezes criamos chaves criptográficas assimétricas com o OpenSSL e com o OpenSSH. No momento da criação de tais chaves, são solicitadas senhas para as mesmas. A dúvida é a seguinte: como proceder para trocar tais senhas?</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Considerando que as chaves sejam RSA, para trocar </del>a <del style="font-weight: bold; text-decoration: none;">senha de uma chave privada do OpenSSL ou do OpenSSH, utilize o comando:</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== Changing </ins>a <ins style="font-weight: bold; text-decoration: none;">Passphrase with ssh</ins>-<ins style="font-weight: bold; text-decoration: none;">keygen ==</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> $ openssl rsa </del>-<del style="font-weight: bold; text-decoration: none;">des3 -in nome-da-chave.key -out nova_chave.key</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">Se desejar tornar </del>a <del style="font-weight: bold; text-decoration: none;">chave privada insegura (remover </del>a <del style="font-weight: bold; text-decoration: none;">senha da mesma </del>- <del style="font-weight: bold; text-decoration: none;">não aconselhável)</del>, <del style="font-weight: bold; text-decoration: none;">execute</del>:</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">The -p option requests changing the passphrase of </ins>a <ins style="font-weight: bold; text-decoration: none;">private key file instead of creating </ins>a <ins style="font-weight: bold; text-decoration: none;">new private key. The program will prompt for the file containing the private key, for the old passphrase, and twice for the new passphrase. Use </ins>-<ins style="font-weight: bold; text-decoration: none;">f {filename} option to specifies the filename of the key file. For example, change directory to $HOME/.ssh. Open the Terminal app and then type:</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> $ cd ~/.ssh/</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> $ <del style="font-weight: bold; text-decoration: none;">openssl rsa </del>-<del style="font-weight: bold; text-decoration: none;">in chave_atual.key </del>-<del style="font-weight: bold; text-decoration: none;">out nova_chave.key</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">To change DSA passphrase</ins>, <ins style="font-weight: bold; text-decoration: none;">enter</ins>:</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">$ ssh-keygen -f id_dsa -p</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">To change RSA passphrase, enter:</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> $ <ins style="font-weight: bold; text-decoration: none;">ssh-keygen </ins>-<ins style="font-weight: bold; text-decoration: none;">f id_rsa </ins>-<ins style="font-weight: bold; text-decoration: none;">p</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Apenas duas observações importantes:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Apenas duas observações importantes:</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l15">Linha 15:</td>
<td colspan="2" class="diff-lineno">Linha 19:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Referências == </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Referências == </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* http://<del style="font-weight: bold; text-decoration: none;">eriberto</del>.<del style="font-weight: bold; text-decoration: none;">pro</del>.<del style="font-weight: bold; text-decoration: none;">br</del>/<del style="font-weight: bold; text-decoration: none;">blog</del>/<del style="font-weight: bold; text-decoration: none;">?p=9</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* http://<ins style="font-weight: bold; text-decoration: none;">www</ins>.<ins style="font-weight: bold; text-decoration: none;">cyberciti</ins>.<ins style="font-weight: bold; text-decoration: none;">biz</ins>/<ins style="font-weight: bold; text-decoration: none;">faq/howto-ssh-changing-passphrase</ins>/</div></td></tr>
</table>
Felipecabral
http://wiki.nosdigitais.teia.org.br/index.php?title=Ssh_-_trocando_senha_da_chave&diff=34741&oldid=prev
Felipecabral em 18h55min de 30 de setembro de 2015
2015-09-30T18:55:37Z
<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="pt-BR">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Edição anterior</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Edição das 15h55min de 30 de setembro de 2015</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l6">Linha 6:</td>
<td colspan="2" class="diff-lineno">Linha 6:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Se desejar tornar a chave privada insegura (remover a senha da mesma - não aconselhável), execute:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Se desejar tornar a chave privada insegura (remover a senha da mesma - não aconselhável), execute:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> openssl rsa -in chave_atual.key -out nova_chave.key</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">$ </ins>openssl rsa -in chave_atual.key -out nova_chave.key</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Apenas duas observações importantes:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Apenas duas observações importantes:</div></td></tr>
</table>
Felipecabral
http://wiki.nosdigitais.teia.org.br/index.php?title=Ssh_-_trocando_senha_da_chave&diff=34740&oldid=prev
Felipecabral: Criou página com 'Muitas vezes criamos chaves criptográficas assimétricas com o OpenSSL e com o OpenSSH. No momento da criação de tais chaves, são solicitadas senhas para as mesmas. A dúv...'
2015-09-30T18:55:11Z
<p>Criou página com 'Muitas vezes criamos chaves criptográficas assimétricas com o OpenSSL e com o OpenSSH. No momento da criação de tais chaves, são solicitadas senhas para as mesmas. A dúv...'</p>
<p><b>Página nova</b></p><div>Muitas vezes criamos chaves criptográficas assimétricas com o OpenSSL e com o OpenSSH. No momento da criação de tais chaves, são solicitadas senhas para as mesmas. A dúvida é a seguinte: como proceder para trocar tais senhas?<br />
<br />
Considerando que as chaves sejam RSA, para trocar a senha de uma chave privada do OpenSSL ou do OpenSSH, utilize o comando:<br />
$ openssl rsa -des3 -in nome-da-chave.key -out nova_chave.key<br />
<br />
Se desejar tornar a chave privada insegura (remover a senha da mesma - não aconselhável), execute:<br />
<br />
openssl rsa -in chave_atual.key -out nova_chave.key<br />
<br />
Apenas duas observações importantes:<br />
* Ao executar os comandos anteriores, será pedida a senha atual da chave e, a seguir, a nova senha (com confirmação).<br />
* A chave gerada não terá as mesmas permissões de segurança da chave anterior. Assim, verifique as permissões anteriores com # ls -l e, depois, troque as permissões na chave nova com # chmod.<br />
<br />
<br />
== Referências == <br />
<br />
* http://eriberto.pro.br/blog/?p=9</div>
Felipecabral