spurin / diveintoansible-lab

Dive Into Ansible Lab
776 stars 494 forks source link

ssh-keygen -H -F 172.18.0.7 not printing. #118

Open Iron777ip opened 8 months ago

Iron777ip commented 8 months ago

Hello Mr James,

I just have an issue with the ssh-keygen -H -F when I use the IP address it does not link any key login to ubuntu1.

Screenshot 2023-10-31 at 23 47 28

Everything else is working properly. I just wanted to know why is not showing the hash key.

Any guidance will be appreciated.

spurin commented 8 months ago

Hiya,

Can you please try the following as a test -

rm -rf ~/.ssh/known_hosts
ssh ubuntu1 -l ansible       <enter the password of password>
exit
cat ~/.ssh/known_hosts

And then share the results, thanks!

Iron777ip commented 8 months ago

I assume that you trying to see if version one works.

Screenshot 2023-11-01 at 19 34 54

please also you can see that I have x2 versions on known_hosts.

Screenshot 2023-11-01 at 19 44 49

However, I was able to create the RSA keys and everything worked I just remembered that at the IP address stage, I did not have the same outcome as per the video instructions.

Many thanks.

spurin commented 8 months ago

Hi,Sorry, no, it was meant to be a -l (for login)? I’m interested in seeing if it has 2 entries after connectingOn 1 Nov 2023, at 19:51, Iron777ip @.***> wrote: I assume that you trying to see if version one works.

please also you can see that I have x2 versions on known_hosts.

However, I was able to create the RSA keys and everything worked I just remembered that at the IP address stage, I did not have the same outcome as per the video instructions. Many thanks.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Iron777ip commented 8 months ago

Hi,

I did both -l and -1 it is still the same output as before has 3 entries. unfortunately I did not screenshotted it. I did try the same commands before, but I did not make any changes so I just thought because of updates.

no changes after following commands.

rm -rf ~/.ssh/known_hosts ssh ubuntu1 -l ansible exit cat ~/.ssh/known_hosts

spurin commented 8 months ago

Gotcha, thanks! I'll check this in the AM. I did recently update the images so possibly something has changed from a behaviour viewpoint 👍

spurin commented 8 months ago

Hi @Iron777ip

It's a behaviour change in ssh, it's no longer auto-creating the reverse DNS entries as it was when I originally created the video, I confirmed it with the following -

# Fingerprint is not known for ubuntu1 at this point -
ansible@ubuntu-c:~$ 
ansible@ubuntu-c:~$ ssh ubuntu1 -l ansible
The authenticity of host 'ubuntu1 (172.18.0.8)' can't be established.
ED25519 key fingerprint is SHA256:2uchNnRsC5eF+6LuI/jaWI1Wsb9LX97KE36uq/cIPd0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ubuntu1' (ED25519) to the list of known hosts.
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ansible@ubuntu1:~$ exit
logout
Connection to ubuntu1 closed.

# These are the existing entries -
ansible@ubuntu-c:~$ 
ansible@ubuntu-c:~$ cat ~/.ssh/known_hosts
|1|3SlkO3G7zpD9BO4n/mp7/BKLa8E=|/bEugV+3woRh3N9V7HeQm4/LaKA= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOW90djP8pFLEbpDd3AnLjOUy1FT9imbW7g+3lyOUbmF
|1|KeDEfRnFYkiYMGMoeSjKsmXTl7A=|sdEE+VOTwi7Yrnl9v2PVp1pFrmY= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKVR9QQLknc3j4JVbg/maLRYOO571wSJjD0c/49SBGdfVXPX/M2ac0/2G5dACejzc4ZfyqYKa7t2dRBgaEsT5ps9RasS2XLBUtJGdXSO8p3Y1aW0b2agHnb6b7NUhcjfzjyQOEHRpkzdXxLD9jHfZJ6NZCNy2L88XpEr1O2sAG96K0Tlgt0X5q5JAcnCE6tWJynSaOrCQw1erXrREoKQl7Tl8F3QH9mvlE3bScyqmYFMXu+KsR4ixWGtDj1LIzEE/sCAmzy2F+IcQ8iE/3fbfJtVDXArEUfPbHF1WhaIF2KQTAYdtS2M4mYGiYTEO7ANvXtJwtvmnmI8puYyNXZuDdAgcTlyfgZzu8uHXXStDt3zBvZ5kze/9L6+e9PMOfbFeA+anExCcmuRtz6ZZ0uea//X6OTEE/IULQY47m3i9IejFtNfuoi0TBeD/N54yXBv9dfHL5meqISXLZ7Nka7hupGl7pyvxF8olDyguD5oLKtscsDz0eos6QVVl1OjaM4fU=
|1|h6EP3UJovfJN88ccwPbejuIEhPc=|LO6fiP/RH+zQDIiEfDRyBSzJyZE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAIllTL6bzJMZp11kPM/Fo9Ufr07yim/KQDPkNz0yhElrd+kx5+tpOVp7AIyXxYhfA0pkuxVdlzCxuVDm/Ls3fk=
ansible@ubuntu-c:~$ 
ansible@ubuntu-c:~$ 

# Connect to the IP, note the new message, it knows it's another name but, it's over precautious -
ansible@ubuntu-c:~$ ssh 172.18.0.8 -l ansible
The authenticity of host '172.18.0.8 (172.18.0.8)' can't be established.
ED25519 key fingerprint is SHA256:2uchNnRsC5eF+6LuI/jaWI1Wsb9LX97KE36uq/cIPd0.
This host key is known by the following other names/addresses:
    ~/.ssh/known_hosts:1: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.18.0.8' (ED25519) to the list of known hosts.
Last login: Thu Nov  2 12:40:39 2023 from 172.18.0.7
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ansible@ubuntu1:~$ exit
logout
Connection to 172.18.0.8 closed.
ansible@ubuntu-c:~$ cat ~/.ssh/known_hosts
|1|3SlkO3G7zpD9BO4n/mp7/BKLa8E=|/bEugV+3woRh3N9V7HeQm4/LaKA= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOW90djP8pFLEbpDd3AnLjOUy1FT9imbW7g+3lyOUbmF
|1|KeDEfRnFYkiYMGMoeSjKsmXTl7A=|sdEE+VOTwi7Yrnl9v2PVp1pFrmY= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKVR9QQLknc3j4JVbg/maLRYOO571wSJjD0c/49SBGdfVXPX/M2ac0/2G5dACejzc4ZfyqYKa7t2dRBgaEsT5ps9RasS2XLBUtJGdXSO8p3Y1aW0b2agHnb6b7NUhcjfzjyQOEHRpkzdXxLD9jHfZJ6NZCNy2L88XpEr1O2sAG96K0Tlgt0X5q5JAcnCE6tWJynSaOrCQw1erXrREoKQl7Tl8F3QH9mvlE3bScyqmYFMXu+KsR4ixWGtDj1LIzEE/sCAmzy2F+IcQ8iE/3fbfJtVDXArEUfPbHF1WhaIF2KQTAYdtS2M4mYGiYTEO7ANvXtJwtvmnmI8puYyNXZuDdAgcTlyfgZzu8uHXXStDt3zBvZ5kze/9L6+e9PMOfbFeA+anExCcmuRtz6ZZ0uea//X6OTEE/IULQY47m3i9IejFtNfuoi0TBeD/N54yXBv9dfHL5meqISXLZ7Nka7hupGl7pyvxF8olDyguD5oLKtscsDz0eos6QVVl1OjaM4fU=
|1|h6EP3UJovfJN88ccwPbejuIEhPc=|LO6fiP/RH+zQDIiEfDRyBSzJyZE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAIllTL6bzJMZp11kPM/Fo9Ufr07yim/KQDPkNz0yhElrd+kx5+tpOVp7AIyXxYhfA0pkuxVdlzCxuVDm/Ls3fk=
|1|EVGDyg/C2b2SB3gkP/ODJYS+oUI=|9rBxEpF5PoqWoTn3g77IeuTf5ZQ= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOW90djP8pFLEbpDd3AnLjOUy1FT9imbW7g+3lyOUbmF
ansible@ubuntu-c:~$ 

I'm guessing this is an enhancement to SSH which is great! I'll add a note to this video! Thanks so much for bringing it to my attention