Unable to SSH into my DietPi device

Successfully reporting back after gaining UART and SSH access.
There were many issues at play.

@MichaIng

neo /etc/network/interfaces

allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100/24

the address can contain the ending 100/24

However in PC etc/network/interfaces I have to remove the ending /24 otherwise the adapter fails to connect and just stay on connecting

netmask 255.255.255.0 is also required, without it, SSH connection reports refused

allow-hotplug eth0
iface eth0 inet static
address 192.168.0.101/24

Moving on, UART screen output displayed *dropbear ssh as starting, even though my dietpi.txt config parameter was set different.

##### Software options #####
# SSH server choice: 0=none/custom | -1=Dropbear | -2=OpenSSH
AUTO_SETUP_SSH_SERVER_INDEX=-2

Lastly, due to firstboot nature of dietpi, if you dont correctly re-image the sd card, this can give problems.

All in all, its resolved. Thanks for help guys.

Better use minicom or Putty. Also the 15000000 speed looks weird, try 115200 to see if it will fix the characters.

I wasn’t aware that screen supports R/W on serial devices as well? The baudrate shouldn’t have something to do with support for those color codes (the “OK” is supposed to be green) but screen seems to not support them. PuTTY does, but this really is a minor visual issue only.

If the baudrate was wrong, you wouldn’t be able to see any character, but just garbage on screen.

So far so great: Logging in at this console allows you to setup network without network and monitor.

1 Like

@Joulinar Yes, UART provided the valuable insight to close the gap on where error was.

@Jappe You were correct to raise First Boot issues, this was likely a problem at numerous attempts, but wasnt recognizable. Maybe in future releases theres a way to disable firstboot setup?

@trendy character problem was caused by loose uart connectors i believe, problem dissappeared

@MichaIng You’re correct screen doesnt, i stick to putty

@StephanStS can confirm AUTO_SETUP_AUTOMATED = 1 was not the issue, I never changed that field at all, neither was no internet access.

Success after many hours, see my edited post above for solution.

Lastly does anybody know why the ending 24 after address 192.168.0.100/24 is fine in NEO but not PC interfaces file? they are both Debian machines, but will cause ethernet to not connection if used in PC interfaces file.

Also, why does pc need netmask but neo doesnt, without netmask in pc, SSH will report connection refused

Are you also using netmask? I can imagine that both cannot be used together. It’s either netmask 255.255.255.0 or /24 after the address.

Both need a netmask. Otherwise it is up to the OS implementation how to evaluate an address without netmask. Linux usually interprets is as a /32 host, Windows might use the default mask for this network class or a /24 which is quite common.

@trendy

just tested your theory, but it didnt work.

adding /24 but removing netmask - adapter doesnt connect

removing /24 and adding netmask - adapter connects

as for the 2nd part and os evaluating, il run some tests

Hmm, the netmask setting has actually long been deprecated in Debian’s ifupdown, replaced the CIDR notation in the address setting: interfaces(5) — ifupdown — Debian bookworm — Debian Manpages
It was originally removed already in 2007, then re-added for backwards compatibility, and again officially deprecated (man page wise) in 2019. Which distro and version are you using on the PC?

EDIT: And at least according to the Debian man page, netmask is used as fallback, it the address field does not contain it as CIDR notation suffix. Hence if you define the second, the first would be overridden, as far as I understand. All given that CIDR notation works at all, of course :smile:.

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