Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4804

Networking and servers • Problem when SSH using windows and Raspberry Pi 4

$
0
0
Hello everyone,

I think this is a very annoying thing that may be interesting for many Raspberry Pi users that use Windows to SSH the Raspberry.

I'm struggling getting a reliable SSH connection between my Raspberry Pi4 and my PC where Windows 10 is installed.

What I'm doing:
I'm trying to SSH into Raspberry using a direct Ethernet cable connection between my PC and the Raspberry itself. These are the steps I've followed and the problems I'm facing:

1) I installed the operating system for the Raspberry via RPI imager (Raspberry Pi OS (64bit)) in a SD card and plugged in the Raspberry. While installing the OS I configured it to have SSH active through RPI Imager.
2) I connect the raspberry pi to the power cable and wait for booting
3) I connect the Raspberry Pi and my PC with an ethernet cable (on my PC Openssh client is installed)
4) I connect a keyboard and a monitor to the raspberry and get the IP address of the raspberry using hostname -i (let's suppose the IP I obtain is 111.1.1.1)
5) I launch the Windows command line following Start->cmd

Now the problems start appearing because:

1) If I try to ping raspberrypi.local, then ping is successful
2) If I try to ping 111.1.1.1, then ping is succesful
3) If I try to ssh pi@raspberrypi.local, then it is successful, but after a few minutes the connection is interrupted (with message 'client_loop: send disconnect: Connection reset') and if I try again, then connection is not established (and the message is 'ssh: Could not resolve hostname raspberrypi.local:'), while if I try ssh pi@111.1.1.1, then connection is not established too (and message is 'ssh: connect to host 111.1.1.1 port 22: Connection refused'). However, if I try to ping again both the IP directly or the hostname, the ping still works!

By the way, if I try the connection using VNC, the behaviour is more or less the same: or not connection at all or connection interrupted after a few seconds.

Why is it sometimes working and sometimes not? What do you think is the reason for this behaviour?

Please let me know if I should provide more data. I googled a lot and searched the forum but was not able to find a real solution, what I'm more interested in is the reason of this behaviour, since I do not really understand why sometimes it works and sometimes not.

Thank you for reading, hope someone has the solution, since this time I'm not really able to find a way!

Statistics: Posted by gev_u — Thu Apr 11, 2024 8:51 pm — Replies 3 — Views 94



Viewing all articles
Browse latest Browse all 4804

Trending Articles