Diferenças entre edições de "Removing a key from the Known Hosts file"

Fonte: TecPorto
Saltar para a navegação Saltar para a pesquisa
(Criou a página com "Example: Sometimes you want to connect to a machine using the same address as a decommissioned one. And guess what? The keys have been decommisioned as well. If you try to S...")
 
 
Linha 1: Linha 1:
 
Example: Sometimes you want to connect to a machine using the same address as a decommissioned one. And guess what? The keys have been decommisioned as well. If you try to SSH into the machine, you'll be prevented with an error such as this:
 
Example: Sometimes you want to connect to a machine using the same address as a decommissioned one. And guess what? The keys have been decommisioned as well. If you try to SSH into the machine, you'll be prevented with an error such as this:
  
<code>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+
<syntaxhighlight lang="bash">
 +
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!    @
 
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!    @
 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Linha 11: Linha 12:
 
Please contact your system administrator.
 
Please contact your system administrator.
 
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
 
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/user/.ssh/known_hosts:3</code>
+
Offending RSA key in /home/user/.ssh/known_hosts:3
 +
</syntaxhighlight>
  
 
This means that key number 3 in your known_hosts file is the offending key and has to be removed.
 
This means that key number 3 in your known_hosts file is the offending key and has to be removed.
Linha 17: Linha 19:
 
This is the right way to remove a key from your Known Hosts file (usually ~/.ssh/known_hosts):
 
This is the right way to remove a key from your Known Hosts file (usually ~/.ssh/known_hosts):
  
<code>ssh-keygen -f ~/.ssh/known_hosts -R machine.address</code>
+
<syntaxhighlight lang="bash">ssh-keygen -f ~/.ssh/known_hosts -R machine.address</syntaxhighlight>
  
 
You may need to repeat the command using the IP address instead of a network name.
 
You may need to repeat the command using the IP address instead of a network name.

Edição atual desde as 15h58min de 30 de maio de 2018

Example: Sometimes you want to connect to a machine using the same address as a decommissioned one. And guess what? The keys have been decommisioned as well. If you try to SSH into the machine, you'll be prevented with an error such as this:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/user/.ssh/known_hosts:3

This means that key number 3 in your known_hosts file is the offending key and has to be removed.

This is the right way to remove a key from your Known Hosts file (usually ~/.ssh/known_hosts):

ssh-keygen -f ~/.ssh/known_hosts -R machine.address

You may need to repeat the command using the IP address instead of a network name.