Announcement

Collapse
No announcement yet.

confusing error(?) message

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    confusing error(?) message

    i'm not really sure where this topic should actually go, so i'm putting it in the focal desktop environment, because that's what i'm using locally, and i THINK this may be a local problem...

    i connect to my external server using dolphin and fish. recently, the host provider moved my server to a new machine, with a new IP address, which temporarily screwed up my ability to access it from my local machine. they recommended that i fix the problem by issuing the following command in the terminal:

    Code:
    ssh-keygen -f "/home/X/.ssh/known_hosts" -R "[THE.HOST-NAME.net]:2223"
    which fixed my ability to access the machine, but now, every time i log into the server, and every time i change directories on the server, i'm presented with the following "error(?)" message:

    Warning: the ECDSA host key for '[THE.HOST-NAME.net]:2223' differes from the key for the IP address '[X.X.X.X]:2223'
    Offending key for IP in /home/X/.ssh/known_hosts:1
    Matching host key in /home/X/.ssh/known_hosts:4
    Are you sure you want to continue connecting (yes/no)?

    i THOUGHT this could be fixed by replacing the old IP address with the new one, in /home/X/.ssh/known_hosts but i was wrong: known_hosts is encrypted, and i don't have the first clue what to replace or how to find what i'm looking for...

    and, yes, there are only two files in /home/X/.ssh/ "known_hosts" and "known_hosts.old"

    does anyone know how to fix this so i am NOT presented with the aforementioned "error(?)" message? i'm spending as much time clicking "Yes" as i am doing the things that i'm supposed to be doing, and it's getting irritating...

    thanks!
    Last edited by przxqgl; Jul 16, 2022, 11:26 AM.
    ⇑ Hybrid Elephant
    http://www.hybridelephant.com/
    ⇓ The world's finest exotic incense

    #2
    You might want to edit your ip and host addresses/names in your post, since your server info is now publicly visible

    Originally posted by przxqgl View Post
    Offending key for IP in /home/mylocaldir/.ssh/known_hosts:1
    Matching host key in /home/mylocaldir/.ssh/known_hosts:4
    the (1) and (4) refer to individual entries or lines in the your local known_hosts file. Since the host name is pointing to the IP address, there are two conflicting keys for the same location, so you probably want to remove the line you are not using - the one with the offending key.

    Comment


      #3
      This is a warning that more than one ssh key is cached for the same server. The first link I came to in a search is older but maybe not outdated:
      https://superuser.com/questions/4210...ecdsa-host-key
      I would see if there is anything useful there knowledge-wise. I would suggest renaming or using mv to change ~/.ssh/ "known_hosts" and known_hosts.old to known_hosts.bak and known_hosts.old.bak respectively. Regenerate the key as you were instructed and this should create a new known_hosts file. That is just a thought, I could be entirely wrong, and someone else with more experience may have a better answer. Until that time, read that link to see if any of those collective posts give you a clue, and if not continue searching the web for:
      "Warning: the ECDSA host key for differs from the key for the IP address"
      (Edit: You said the file is encrypted which leads me to think that you are not able to edit it. If that is not the case you will do as Claydoh said and edit the file to remove the keys. More info in that link above.)
      Last edited by rab0171610; Jul 16, 2022, 11:14 AM.

      Comment


        #4
        Originally posted by claydoh View Post
        You might want to edit your ip and host addresses/names in your post, since your server info is now publicly visible
        done, however the IP address in the original post is no longer the current IP address, so i wasn't that worried...

        Originally posted by claydoh View Post
        the (1) and (4) refer to individual entries or lines in the your local known_hosts file. Since the host name is pointing to the IP address, there are two conflicting keys for the same location, so you probably want to remove the line you are not using - the one with the offending key.
        now it's even more confusing, because:

        1) there are only three lines in the "known_hosts" file, and

        2) they are all three labeled [1]

        ??
        ⇑ Hybrid Elephant
        http://www.hybridelephant.com/
        ⇓ The world's finest exotic incense

        Comment


          #5
          Originally posted by rab0171610 View Post
          I would suggest renaming or using mv to change ~/.ssh/ "known_hosts" and known_hosts.old to known_hosts.bak and known_hosts.old.bak respectively. Regenerate the key as you were instructed and this should create a new known_hosts file.
          That's what I'd do, if it is not obvious which line is The One
          That is after I used trial and error of course
          Starting over is safe, clean, and quick.

          Comment


            #6
            among other things,
            Code:
            man ssh-keygen
            contains a wealth of information... thanks, guys!
            ⇑ Hybrid Elephant
            http://www.hybridelephant.com/
            ⇓ The world's finest exotic incense

            Comment


              #7
              Originally posted by przxqgl View Post
              ... known_hosts is encrypted...
              known_hosts is not encrypted; the lines have a hash of the hostname, the key type, and the public key. (The hash and the key look like they are base64 encoded.)

              If you know the hostname, ssh-keygen -F can find it:
              Code:
              ssh-keygen -F THE.HOST-NAME.net
              Regards, John Little

              Comment


                #8
                Originally posted by jlittle View Post
                known_hosts is not encrypted;
                encrypted or hashed look the same to someone who doesn't know the difference.


                Originally posted by jlittle View Post
                If you know the hostname, ssh-keygen -F can find it
                which i learned (among many other things) from doing
                Code:
                man ssh-keygen


                than que!
                ⇑ Hybrid Elephant
                http://www.hybridelephant.com/
                ⇓ The world's finest exotic incense

                Comment

                Working...
                X