I installed openssh-server and created a key with ssh-keygen. I then attempted to test it using local port forwarding by doing ssh -L 8080:www.nytimes.com:80 127.0.0.1. However, the key fingerprint that this command provides is not the key fingerprint I get when I do ssh-keygen -l. Even if I delete my .ssh directory, I still get the same fingerprint, which is not the one I created with ssh-keygen. Is there another key on my system? Where is this key? How can I select this key for use by openssh-server?
|
|
||||
|
|
|
When you make a SSH session, two different key pairs (with a fingerprint for each pair) are involved. One is the user's key which is stored in The other is the SSH server's key. This is the key you see the fingerprint for when you connect to a different server for the first time. This key's identity is used to make sure you are logging in to the SSH you intend to. This is important if you are using passwords because you wouldn't want to accidentally try to login to an attackers machine: the attacker would get your password when you typed it in. Then the attacker could login to the machine you thought you were logging in to! The keys a SSH server uses to identify itself when you login to it are located in You can actually change where the SSH server looks for the key in the By default, *There are different encryption algorithms. Each one uses a different key. Common ones are DSA (weak), RSA (default), and ECDSA (hopefully strong, somewhat new). |
|||||
|
|
SSH host keys are stored in You can list the fingerprint of the keys by |
|||
|
|
|
The fingerprint of your server will obviously not display as the fingerprint of the public/private key pair you generated, as they are separate from each other. |
|||
|
|