I am running into trouble when trying to connect to my RPi via SSH. Since I could not connect, I decided to extract the microSD card from my RPi and run imager_1.7.4.exe, to install the OS again and set basic configuration options. As explained in the e-book, I set up the hostname, SSH enabled with password authentication, user name and password, WI-FI network configuration and local settings before writing to the microSD card. I installed the microSD card back into the RPi, disconnected the RPi from the monitor, keyboard and mouse to run it headless, powered the RPi, waited for a few minutes and ran putty.exe on my computer. However I receive a message back telling me that the connection to the host cannot be established because the host does not exist. I repeat the procedure, and I get the same answer. So I decided to try the connection using the IP address of the RPi instead of the host name. When doing this, a window opens asking me for the login user name and password. I enter these and the window freezes and doesn’t show any prompt. From there on, I cannot follow any further. Moreover, if I connect the monitor, keyboard and mouse to my RPi, open a terminal session and check for the hostname, I can see that it was correctly set (I used the default setting, Hostname=raspberrypi), but putty doesn’t seem to recognize it. Could anyone help me with this problem?
Hi.
Are you sure you’re using the right settings? Please note that the hostname and username are two different things.
Do you have your Raspberry Pi connected to an ethernet cable? Some people reported having issues trying to connect to the RPi via SSH when it was connected to an ethernet cable.
I can’t see your images. You need to upload your images to google drive, dropbox or imgur and then share a link to the pictures.
Regards,
Sara
Hi Sara.
I have just arrived home and cannot answer properly to your response, buy I’ll do so tomorrow morning.
In the meantime I can tell you that I am not using an Ethernet cable. I am using WI-FI, and both my computer and the RPi are connected to the same SSID. I have understood that the hostname and the username are different things, and when configuring the RPi I have used the default hostname (raspberrypi), which I later on verified on a terminal session with the ‘hostname’ command. Hence I think that the RPi hostname is certainly set to ‘raspberrypi’, but when using ‘raspberrypi’ as the hostname in the puTTY configuration window, puTTY does not find this hostname. However, it does find it when using the IP address.
Tomorrow morning I shall upload the images properly, and maybe these help you to point out the mistake I am probably making.
Thanks for your prompt response. My best regards,
Darío.
Hi Sara.
I have just arrived home and cannot answer properly to your response, buy I’ll do so tomorrow morning.
In the meantime I can tell you that I am not using an Ethernet cable. I am using WI-FI, and both my computer and the RPi are connected to the same SSID. I have understood that the hostname and the username are different things, and when configuring the RPi I have used the default hostname (raspberrypi), which I later on verified on a terminal session with the ‘hostname’ command. Hence I think that the RPi hostname is certainly set to ‘raspberrypi’, but when using ‘raspberrypi’ as the hostname in the puTTY configuration window, puTTY does not find this hostname. However, it does find it when using the IP address.
Tomorrow morning I shall upload the images properly, and maybe these help you to point out the mistake I am probably making.
Thanks for your prompt response. My best regards,
Darío.
This is the link to the GoogleDrive directory where I put the images. I hope you can see them, otherwise please let me know.
Link: https://drive.google.com/drive/folders/1AVCu5vAqCK9KnpIP4g-iGFPjsULKnxZO?usp=share_link
Thank you for your help!
Hi Sara.
I have just tried once again to login via SSH using puTTY, and received the same response as before (which I included in the images saved in the directory of the link): ‘Unable to open a connection to raspberrypi. Host does not exist’.
Then I repeated the same procedure using the IP address instead of the hostname, as I had also already done before. In this case puTTY connects to the RPi and asks for the password. But in this occasion, when I entered the password, instead of halting as usually (as I showed in the image saved in the directory of the link), this time puTTY recognized the hostname and showed the prompt with the hostname that it could not recognize before, allowing me to enter remote commands to my RPi. I have just included this new image in the directory of the link, and have called the file ‘New PuTTY Response using IP address.jpg’
Can you think of a good explanation to account for this erratic behaviour? Why didn’t puTTY recognize the hostname at first, but then updated the prompt using this hostname?
Finally I have another question related to this SSH authentication process: when configuring the microSD card to load the OS, I set SSH authentication via password. However, I was never asked to set this password. I only set the user and password for my RPi. And in the RPi configuration tool I can only set SSH authentication, but it doesn’t ask if it is password or public-key authentication. Can password authentication be set from the RPi configuration tool or via a terminal command?
Thank you for your support and patience!
My best regards,
Darío.
Hi.
Yes.
I can see your images now.
Are you using a Wi-Fi extender? It might be because of that.
I never had that issue and unfortunately, I’m not sure exactly how to solve it.
I found these two discussions with suggestions for possible solutions:
- https://raspberrypi.stackexchange.com/questions/45198/cant-connect-to-pi-on-local-network-via-hostname-local-on-windows
- https://raspberrypi.stackexchange.com/questions/36330/cannot-access-raspberry-pi-by-hostname
Let me know your results.
I hope this helps.
Regards,
Sara
Hi Sara.
I am sorry that I could not check the two discussions you referred me to yet, but I ran into some domestic troubles in my house that became priority. I shall read them as soon as I can, and let you know if I can find a lead to the cause of the problem. Anyway I can still achieve the SSH connection using the IP address, and once connected the hostname automatically updates to raspberrypi in the window prompt. I apologize for my delay, I waht to thank you once again for your fast response and support, and I shall let you know if I can find a solution or at least a cause to account for the problem.
My best regards,
Darío.