Question RaspberryPi and Windows 10 connection via SSH

Jackedd

Reputable
Nov 17, 2020
58
2
4,535
Hi everyone,

Im trying to build a project using a Pi motherboard and connecting to it on Windows 10 via SSH but I ran into some problems.
First I tried to connect using Command Prompt but it doesnt work for some reason and Im gonna post the errors.
So the error im running into in Command prompt is this: View: https://imgur.com/bTM0VoY

Regarding the error in the image I linked, I literally tried every single combination of name it could have when I did the imager on the SD, from the hostname, that is default "raspberrypi" until the Username that I gave it myself and none of them are working with the IP that it has been given by my router. I bought the Pi from someone else which used it or he has it from a company that used, maybe I need to know the hostname that him/company that used the Pi before me gave it?
Because I thought I can reinstall the Pi with the Pi imager on a microSD and SSH connection, but maybe that's impossible since its not a "clean" Pi?
Also I searched a little through the forum and i found that i can use Putty to connect via SSH but when I use putty it says like this:
First thing: if i use the username i gave to the Pi in the imager it doesnt connect by any means to the Pi.
Second thing: i used the hostname on the Pi imager which is "raspberrypi" and it connected and gave me this error: View: https://imgur.com/oFI6Par

Since it only connected only with the name "raspberrypi" in the Putty i though ok, this is the hostname, so now i have the hostname and i have the IP the router gave so it should be easy now, so when i saw this error i was like, ok I dont know what this means but if i know the hostname and the IP lets try again in the command prompt, but i get the same error that i showed you in the first image. So now im stuck cause i cant connect to my PI via SSH.
So my question are:
1. Do I need to know the hostname this PI had when it was used by the person/company before me?
2. If i cant get that name, cant i reboot the PI via PI imager and miscroSD boot? (btw this is what im trying and gives me these errors)
3. If i get these errors via SSH, should I try to wire a keyboard, mouse and a display to the PI to see if i can do something that way?

I dont know, i was trying to figure it out myself but i dont want to make a mistake and destroy the PI or something else.
Btw, i have a Raspberry PI 4 model B 2gb and i use a cable from router to the PI, not wi-fi connection for the internet acces.
 

OldSurferDude

Reputable
May 18, 2019
171
31
4,640
Default user name and password for the OS RPi generated by the imager.

If I remember correctly, when you configure the image in the imager software you can set a static the IP address. Most routers allow you to see the addresses of connected devices. You seem to have figured it out.

From a dos box in windows:
Code:
ssh  pi@[your ip address]
should get you connected.
You will be prompted for the password which is: raspberry

I agree with @kanewolf, use PuTTY. You can create and icon on your desktop that has a "Target" of:
Code:
"C:\Program Files\PuTTY\putty.exe" -ssh pi@[pi's IP address] -pw raspberry
and the "Start in" box:
Code:
"C:\Program Files\PuTTY\"

If you're not going to be using the GUI, run the server OS. It's another option when you select which version of RPi you're going to use.

OSD
 

Cj-tech

Admirable
Jan 27, 2021
534
67
8,940
Hi everyone,

Im trying to build a project using a Pi motherboard and connecting to it on Windows 10 via SSH but I ran into some problems.
First I tried to connect using Command Prompt but it doesnt work for some reason and Im gonna post the errors.
So the error im running into in Command prompt is this: View: https://imgur.com/bTM0VoY

Regarding the error in the image I linked, I literally tried every single combination of name it could have when I did the imager on the SD, from the hostname, that is default "raspberrypi" until the Username that I gave it myself and none of them are working with the IP that it has been given by my router. I bought the Pi from someone else which used it or he has it from a company that used, maybe I need to know the hostname that him/company that used the Pi before me gave it?
Because I thought I can reinstall the Pi with the Pi imager on a microSD and SSH connection, but maybe that's impossible since its not a "clean" Pi?
Also I searched a little through the forum and i found that i can use Putty to connect via SSH but when I use putty it says like this:
First thing: if i use the username i gave to the Pi in the imager it doesnt connect by any means to the Pi.
Second thing: i used the hostname on the Pi imager which is "raspberrypi" and it connected and gave me this error: View: https://imgur.com/oFI6Par

Since it only connected only with the name "raspberrypi" in the Putty i though ok, this is the hostname, so now i have the hostname and i have the IP the router gave so it should be easy now, so when i saw this error i was like, ok I dont know what this means but if i know the hostname and the IP lets try again in the command prompt, but i get the same error that i showed you in the first image. So now im stuck cause i cant connect to my PI via SSH.
So my question are:
1. Do I need to know the hostname this PI had when it was used by the person/company before me?
2. If i cant get that name, cant i reboot the PI via PI imager and miscroSD boot? (btw this is what im trying and gives me these errors)
3. If i get these errors via SSH, should I try to wire a keyboard, mouse and a display to the PI to see if i can do something that way?

I dont know, i was trying to figure it out myself but i dont want to make a mistake and destroy the PI or something else.
Btw, i have a Raspberry PI 4 model B 2gb and i use a cable from router to the PI, not wi-fi connection for the internet acces.
Currently, if you ping raspberrypi.local, do you get an IP address returned? It sounds like it might be configured for a different network.

What I would do:
  1. Use the Raspberry Pi Imager to create a fresh image of the Raspberry OS
  2. Upon imaging the microSD card, remove it and place it in the computer again.
  3. Navigate to the microSD card in File Explorer and add a file called “ssh” with no extension and no contents (you will need to create a blank ssh.txt document then remove the .txt portion).
  4. After adding that file, eject the microSD card and place it in the powered off RPI.
  5. Connect the RPI to ethernet and turn on the RPI.
You should be able to use Putty and connect to it using raspberrypi.local as the host name. If not, try pinging raspberrypi.local - if you get the IP address, try connecting with that. If you can’t connect, you may need to adjust your network’s settings.

If your DNS is not working properly, you may need to use a tool such as Advanced IP Scanner to find the IP address.
 

Jackedd

Reputable
Nov 17, 2020
58
2
4,535
Ok so i tried CJ-tech's idea and it brought me to this : View: https://imgur.com/a/kHeFxu5

When I was asked about the Pi name I used the one I wrote on the imager "pi" but when it asked me about the password It didnt let me write anything, letters or numbers, i tried the password I put on the imager basically without showing that I write something and I pressed enter and It just gave me incorrect password, and after giving me 3 times that it brought me to the rfkill blocked your wifi so I tried to unblock it with the sudo config, but nothing happened after I choosed my country and I tried something else what I found on internet but nothing happens, what do I do next, or am I in a dead spot here and need to try something else?
 
Last edited:

Jackedd

Reputable
Nov 17, 2020
58
2
4,535
Update: bassically what happened there is that i got connected to the pi and that rfkill blocked my wifi but thats not a problem since i have a cable that links the router and the Pi, so this all good.
But after i got connected to the Pi idk what can I do, cause I was expecting to be more interactive, idk some icons to acces or something. xD
For example to get used to this can someone explain to me how can i play a song on my Pi through Putty or link me a tutorial?
I found one but its 9yrs old and I dont think things work like that today. :)
 

OldSurferDude

Reputable
May 18, 2019
171
31
4,640
ssh is not a GUI (Graphical User Interface). It is a TUI (Text [only] User Interface) More often called called a CLI (command line interface). No icons, no mouse.

If you want a GUI, you'll have to run the full OS. You would enable VNC and connect to your headless RPi from another computer using a VNC viewer.

You can install and run programs with a TUI/CLI. In doing so, you have to have a clear understanding of where the programs are stored, how to configure and invoke them all from the command line. It takes time and patience.

best of luck

OSD
 

Cj-tech

Admirable
Jan 27, 2021
534
67
8,940
Update: bassically what happened there is that i got connected to the pi and that rfkill blocked my wifi but thats not a problem since i have a cable that links the router and the Pi, so this all good.
But after i got connected to the Pi idk what can I do, cause I was expecting to be more interactive, idk some icons to acces or something. xD
For example to get used to this can someone explain to me how can i play a song on my Pi through Putty or link me a tutorial?
I found one but its 9yrs old and I dont think things work like that today. :)
First of all, when you type passwords into the terminal, they are hidden for security reasons but are being typed even though you can’t see. Secondly, the terminal is a CLI not a GUI. This means it has no graphics whatsoever. You can’t do it through Putty, but you can setup Remote Desktop and connect to the GUI.