RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Unable to Use Hostname to SSH

    Scheduled Pinned Locked Moved Help and Support
    retropieremote accessssh
    13 Posts 6 Posters 4.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FitchnerAuBarca
      last edited by

      I know, I know, I shouldn't immediately jump to the forum with a question as my first post... However, I've done about as much as I can up to this point and I was really hoping someone would be able to help me out. My RP has been running great. It's connected to my WiFi and I can SSH into using it's IP address just fine.

      I wanted to change the hostname so that I don't always have to remember the IP address. I did it within the raspi-config tool and used the default hostname of retropie. I've looked into my router's settings and it appears that the hostname has been adjusted there as well, so I think that I should be able to SSH into this RP just fine. However, I still can't seem to get this to work.

      From within my router, I can see that the hostname is listed:

      0_1521922111531_Screenshot from 2018-03-24 15-06-54.png

      If I try to ping the RP using the hostname, I get no response. However, if I ping using the IP address, then I receive a response just fine:

      0_1521922406460_Screenshot from 2018-03-24 15-12-20.png

      I'm certain that the hostname has also been adjusted within the RP if I SSH into it and check the /etc/hosts file:

      0_1521922522915_Screenshot from 2018-03-24 15-14-53.png

      Is there anything else that I can check to see what would be causing this issue? Would it potentially be an issue with my router? I don't have my own personal router, it's the one that was given to me by my ISP (which is Comcast if that helps at all). Any help on this is much appreciated :)

      herb_fargusH 1 Reply Last reply Reply Quote 0
      • SanoS
        Sano
        last edited by Sano

        Could you try to use retropie.local?

        1 Reply Last reply Reply Quote 1
        • herb_fargusH
          herb_fargus administrators @FitchnerAuBarca
          last edited by

          @fitchneraubarca I've seen similar things in the past with some of my builds as well. Not that I have a solution as I never really dug into it but just so you know you aren't going crazy

          If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

          Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

          1 Reply Last reply Reply Quote 1
          • F
            FitchnerAuBarca
            last edited by FitchnerAuBarca

            @herb_fargus happy to hear that I'm not the only one :)

            @Sano that seems to work! Here's what things look like within my terminal:

            0_1521930526366_Screenshot from 2018-03-24 17-26-11.png

            So it seems like there's a security concern since, right before I was able to connect using retropie.local, the terminal asked the following:

            The authenticity of host 'retropie.local (10.0.0.xxx)' can't be established.
            ECDSA key fingerprint is SHA256:+7blah blah blah.
            Are you sure you want to continue connecting (yes/no)? yes
            Warning: Permanently added 'retropie.local' (ECDSA) to the list of known hosts.

            Not sure at all why that's happening. Also, why is retropie.local necessary? I've tried using retropie after I remoted in using retropie.local, but I still wasn't able to.

            HurricaneFanH 1 Reply Last reply Reply Quote 0
            • HurricaneFanH
              HurricaneFan @FitchnerAuBarca
              last edited by

              @fitchneraubarca You get that message the first time you ssh over to the pi. I've seen that the first time I've logged into any new build.

              F 1 Reply Last reply Reply Quote 0
              • F
                FitchnerAuBarca @HurricaneFan
                last edited by

                @hurricanefan Darn... Got excited that I saw something new. Well, sounds like I just gotta stick with SSH'ing with retropie.local for now.

                SanoS 1 Reply Last reply Reply Quote 0
                • SanoS
                  Sano @FitchnerAuBarca
                  last edited by Sano

                  @fitchneraubarca
                  On windows, the .local suffix of mDNS is included in the search domains.
                  For security reasons, it's no possible on Linux, you have to use the FQDN (and not short names) for mDNS entries.
                  Even by adding .local to DNS search domains it doesn't work because mDNS resolution doesn't use the DNS resolv.conf file...

                  I did some searching a while ago but didn't find an easy solution aside from changing mdns suffix from .local to something else...

                  A quick and dirty solution for using the short name is to add an entry in /etc/hosts on your workstation, but this won't follow eventual IP change of your raspberry.
                  You can also create an alias on your workstation by adding alias retropie="ssh pi@retropie.local" in your ~/.bashrc file. That's what I did.

                  Drakaen391D 1 Reply Last reply Reply Quote 1
                  • Drakaen391D
                    Drakaen391 @Sano
                    last edited by

                    @sano so you just enter "retropie" nothing else into the comandline?

                    RPi B & RPi 3B OC (Now Raspberry pi 4b 8gb)
                    Retropie (Latest Stable)
                    PiBox with Wind Tunnel Cooling System

                    SanoS 1 Reply Last reply Reply Quote 0
                    • SanoS
                      Sano @Drakaen391
                      last edited by Sano

                      @drakaen391
                      Yup !
                      With key-based ssh authentication, nothing else to type :)

                      ClydeC 1 Reply Last reply Reply Quote 0
                      • F
                        FitchnerAuBarca
                        last edited by

                        Thanks @Sano ! My networking understanding isn't quite up to your level. However, I overall understand what you're saying and it all makes sense. At least there's a logical explanation to all of this :) Thanks for all of your (and everyone else's) help on this.

                        1 Reply Last reply Reply Quote 1
                        • ClydeC
                          Clyde @Sano
                          last edited by

                          @sano said in Unable to Use Hostname to SSH:

                          With key-based ssh authentication, nothing else to type :)

                          Only if the key itself has no passphrase, which makes it usable by anyone who gets their hands on it. It also makes it easy to jump systems if the one holding the key is compromised.

                          I mention this mostly for @FitchnerAuBarca and other ssh newbies. I don't think this is a big security concern in most Retropie use cases, but I think it's worth noting for the sake of completeness, especially for people who are new to the whole concept of key-based authentication. :)

                          SanoS 1 Reply Last reply Reply Quote 1
                          • SanoS
                            Sano @Clyde
                            last edited by

                            @clyde
                            Yes, you may be careful if your key has no passphrase (that's why it's protected by mandatory and specific access rights on the system).
                            You may also use a passphrase and an ssh agent to only have to type the passphrase once per user session ;)

                            ClydeC 1 Reply Last reply Reply Quote 1
                            • ClydeC
                              Clyde @Sano
                              last edited by

                              @sano said in Unable to Use Hostname to SSH:

                              You may also use a passphrase and an ssh agent to only have to type the passphrase once per user session ;)

                              Correct, I had that in mind but didn't articulate it. Thanks for the addition. :)

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post

                              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.