Unable to ssh into raspberry pi 0

Hello all,

I have a fresh install of openwrt 21.02.1 on my pi0. I connected the pi0 via usb-Ethernet cable to my pc and for some reason I really cannot ssh into the pi.. ssh into 192.168.1.1 just says no route to host.. can someone help?

It may be that the usb-Ethernet device you're using needs a package installed to work - of course, that's a catch 22, because you can't load the package (in the usual way) until you get a connection happening

Can you attach a keyboard and screen to the Pi?

Perhaps need to set static ip address on PC 192.168.1.2. Not sure about PI but how can you tell it has even booted? LEDs? Info about PI 1st time connect ethernet issues here about halfway down page.

Yes, I have them connected..

well, now you can see what's going on, see what IP address you have there, by running

ip address

See if there's any issues, by running

dmesg

etc etc

Did not try the changing the ip via cli. Assigned an ip to the pi via the connected pc. For some reason, the computer recognizes that a device is connected, but ssh does not seem to work

Will do! Not near the pi at the moment. Wil post an update when I’m near it

@jaromanda managed to build a custom firmware with usb related packages. Ping now seems to work, but when i try to ssh to openwrt, it says connection refused..

Suspecting firewall, I added firewall rules according to https://github.com/pandysong/openwrt/blob/master/sh.md, still says connection refused

No idea, can't see what you did when you followed that advice for 4 year old LEDE in configuring OpenWRT

It still does not matter.. even without the 4 year old configuration ssh still is refused..

If you can do that, just clear the password and/or firewall.

First I would wonder if this firmware has an active ssh server at all. On the console run netstat -lp | grep ssh to check if anything is listening on port 22.

The instructions are the proper way to open the firewall for SSH connections from the wan side, of course the network interface that you are trying to ssh to must be in the wan zone.

i get the following..

tcp      0        0        0.0.0.0:ssh     0.0.0.0:*      listen     534/dropbear
tcp      0        0        :::ssh              :::*               listen     534/dropbear

A short edit on what I’m trying to achieve: https://www.makeuseof.com/tag/raspberry-pi-vpn-travel-router/

I’m using a pi zero w. I connected the pi via an usb to Ethernet adapter like the one below to Ubuntu..

Update: It might be that this specific version of the ethernet <-> usb does not work so well with raspberry pi 0.
See bottom of the page: https://elinux.org/RPi_USB_Ethernet_adapters
Will confirm this once I test this with a supported adapter

Tried a lot of things..

@mk24 / @lleachii: Can you guys help? Recent stock firmware for raspberry pi + Apple USB to ethernet adapter. Trying to connect the pi to my Ubuntu workstation. Ping works, openwrt device shows up on ifconfig. When I try to SSH, i get the connection refused message. Set a static IP for the Pi.

When I enable wifi on the openwrt instance, I'm able to ssh into the device.

I am pretty much stuck at this point..

I assume you set this rule:

config rule
    option src              wan
    option dest_port        22
    option target           ACCEPT
    option proto            tcp

Other than perhaps it's missing single quotes 'example' - try the redirect instead:

config redirect                           
        option target 'DNAT'                                 
        option src 'wan'                                           
        option dest 'lan'                                    
        option name 'SSH'           
        option proto 'tcp'        
        option dest_port '22'
        option dest_ip '192.168.1.1'  
        option src_dport '22'

:warning: Also

  • are you saying that 192.168.1.1 is the IP on your WAN port?
  • Is there a LAN...if so what is its IP?
  • I don't recall seeing any of your other configs

Thanks for the quick reply.. I tried modifying the firewall rules.. still no luck :frowning:

Yes..

Configs are pretty same out of the box...

I have had a breakthrough though.. I managed to find a site that helped me configure access to internet first and then ssh via the ISP router.. Did the trick for me :slight_smile:

https://pentestit.de/raspberry-pi-zero-w-als-reise-router-einrichten/

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.