Understanding SSH Host Keys

แชร์
ฝัง

ความคิดเห็น • 28

  • @markdavidil
    @markdavidil 9 วันที่ผ่านมา

    best explanation on youtube, well done!

    • @sudomateo
      @sudomateo  9 วันที่ผ่านมา

      @@markdavidil thank you for the kind words! Glad you enjoyed the video!

  • @sureshmg6786
    @sureshmg6786 10 หลายเดือนก่อน +2

    That is very well explained, I learned a lot from this video than I expected 🔥Keep going 👏🏼

    • @sudomateo
      @sudomateo  8 หลายเดือนก่อน

      Thank you!

  • @chemseddsen
    @chemseddsen ปีที่แล้ว

    Very interesting explanation 🙏 thanks.
    I confirm: "Part of being a great Engineer, is knowing your tools and how to use them."

    • @sudomateo
      @sudomateo  ปีที่แล้ว

      If you like that you might like some of the videos I collaborated on with my friend: th-cam.com/video/I7xqY-YxtbY/w-d-xo.html

  • @michelthibodeau8550
    @michelthibodeau8550 2 หลายเดือนก่อน

    Good explanations ! many thanks !

    • @sudomateo
      @sudomateo  2 หลายเดือนก่อน

      You're welcome!

  • @bat_man1138
    @bat_man1138 8 หลายเดือนก่อน

    Nice vid brah

  • @itspk9076
    @itspk9076 4 หลายเดือนก่อน

    You got a new subscriber😊

    • @sudomateo
      @sudomateo  4 หลายเดือนก่อน

      Heck yeah! Thank you kindly!

  • @kmille1398
    @kmille1398 5 หลายเดือนก่อน

    Great video. Well done. Are SSH Host keys only produced by the administrator of the server you are connecting to? I heard you say you generated your own public and private key pair. That public key you mentioned you created as part of that pair is different than the SSH Host key you are talking about in the video, correct? Is the public/private key pair you created to encrypt and decrypt PGP files only and not for host authentication (for example, logging into a server as you do in the video)?

    • @sudomateo
      @sudomateo  5 หลายเดือนก่อน

      Correct! SSH host keys are generated by the system administrator where the SSH service is running. Usually the SSH host keys are generating automatically when the SSH service starts up if they are not already present.
      The SSH key pair (public/private) that you create for yourself is used to authenticate to a server that's speaking SSH. You upload the public key to the server via a trusted means and then when you want to connect to that server via SSH you just use your private key to encrypt some data and perform a key exchange that only your corresponding public key can decrypt successfully. However, when you first connect to a server over SSH, your local SSH client will ask you to verify the SSH host keys provided by the SSH service. That way when you connect in the future you can be sure you're connecting to the same SSH service as before and it wasn't tampered with.

  • @aabishkarwagle8708
    @aabishkarwagle8708 ปีที่แล้ว

    you are such a good explainer 😮 subscribed

    • @sudomateo
      @sudomateo  ปีที่แล้ว +1

      Thank you! I get that often which is why I like to create videos.

  • @ruffneck718
    @ruffneck718 8 หลายเดือนก่อน

    Great video Sir

    • @sudomateo
      @sudomateo  8 หลายเดือนก่อน

      Thank you!

  • @user-rv2vn8vs7v
    @user-rv2vn8vs7v 10 หลายเดือนก่อน

    Beautiful !

  • @xpnt_
    @xpnt_ ปีที่แล้ว

    thanks for the explanation!😁

    • @sudomateo
      @sudomateo  11 หลายเดือนก่อน +1

      You're welcome!

  • @alsonyang230
    @alsonyang230 ปีที่แล้ว

    Big thumbs up, I can move now (unfreezed)

  • @jimmyr3735
    @jimmyr3735 ปีที่แล้ว

    Keep it up brother 😀

  • @user-pz8cm8wk4t
    @user-pz8cm8wk4t 9 หลายเดือนก่อน

    what's the purpose of this process? Does not everyone could get the public key and send to you ? How could the host key or the fingerprint verify the server?

    • @sudomateo
      @sudomateo  8 หลายเดือนก่อน

      When you connect to an instance with SSH you receive the host key and are asked to trust it before connecting. Once you trust it then future connections still receive the host key from the instance and see if you have already trusted the host key for that particular instance. If you did then the connection will proceed. If you didn't trust that host key or if the host key that was presented by the instance changed then the connection would not be trusted and won't proceed. So it's a way to prevent man in the middle attacks and connecting to the a compromised instance.

  • @cyberwithdani
    @cyberwithdani ปีที่แล้ว

    When you changed the host keys, you didnt change your private key on your laptop. So how did your previous private key work with the new host keys?

    • @sudomateo
      @sudomateo  11 หลายเดือนก่อน

      You don't need to change your private key in this case. The host still had my public key, but the host key changed. I removed the old host key from my ~/.ssh/known_hosts, reconnected, and trusted the new host key. Then the connection proceeded and I was able to use my existing private key since the host already had my public key.

  • @ndefrutitus4201
    @ndefrutitus4201 ปีที่แล้ว

    Great stuff ,i have same error but this solution does not work bc i can't even access the /etc/.ssh path . am using an amazon ec2 instance with a public ip, i can successfully ssh into it, when i want to ssh to another server from this server using its private ip ,it gives me this below error "
    [root@ip-10-0-0-237 ec2-user]# ssh ec2-user@10.0.2.241
    The authenticity of host '10.0.2.241 (10.0.2.241)' can't be established.
    ECDSA key fingerprint is SHA256:H6vZk6QBx/tDE9Qwc4PgUZL4hfyQE+EtIf1SZzxKxgg.
    ECDSA key fingerprint is MD5:e1:e1:71:b2:c7:6d:08:ed:a8:bb:15:21:c3:75:7e:e4.
    Are you sure you want to continue connecting (yes/no)?
    Host key verification failed.
    [root@ip-10-0-0-237 ec2-user]#
    can you advice how to resolve this

    • @sudomateo
      @sudomateo  ปีที่แล้ว

      You don't need access to /etc/.ssh. You only need access to ~/.ssh which is the .ssh directory in your user's home directory. In your case you can also check the ~/.ssh/known_hosts file to remove the host key for 10.0.2.241 and try the SSH again.