OpenWrt 19.07.5 ssh-login as root

You changed the router IP to 192.168.0.1?

1 Like

Now I've got a really daft question for you, but I'm gonna ask it anyway: is 192.168.0.1 the IP address of your OpenWRT instance? The default IP address is 192.168.1.1; have you changed it?

1 Like

SSH Access

Dropbear offers SSH network shell access and an integrated SCP server

Dropbear Instance

Interface

  • unspecified

Listen only on the given interface or, if unspecified, on all

Port 22

Password authentication yes

Allow SSH password authentication

Allow root logins with password yes

Allow the root user to login with password

Gateway Ports open

Allow remote hosts to connect to local SSH forwarded ports

By screenshots I meant literally that: images, rather than text.

This may help: https://www.google.com/search?client=firefox-b-d&q=Linux+equivalent+of+snipping+tool

Yes, I changed the standard IP from 192.168.1.1 to 192.168.0.1 and under this IP (192.168.0.1) I also reach the web interface.

1 Like

Thank you so far here!
I'm k.o.
I'm quitting for today.
Greeting

And now I've got another really daft question for you: is the OpenWRT router the only device on your network with that IP address, or is there another device which also has the IP address of 192.168.0.1?

3 Likes

I have a solution, but not the real cause of the problem.
I changed the ssh port from 22 to xyz and got along with:
"ssh -p xyz root@192.168.0.1" logged on to the console and it worked immediately.

I've rallied out of the loggs that something is wrong with Port 22.
So this is the real cause that dropbear with port 22 does not work.
22 but at ssh the default port is if I have learned this correctly.
Best regards

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.

1 Like

Unfortunately, the problem has not been solved!
There must be a reason why ssh with port 22 does not work on a fairly new installation, but with another port immediately.
That can affect anyone.
Thank you and greetings

Please provide details regarding that "something".

1 Like

Now that I can access the router via ssh on the console, I have looked at the ssh_config and sshd_config.
In the ssh_config, each line is preceded by a
and in the sshd_config in almost every line, even before "Port 22"
also for line: PubkeyAuthentication yes is a .
However, I have in the settings 'System/administration/ssh-access'
"Password authentication" is set to no and "Allow root logins with password" to no.
This means that only root login with pub-key is possible.
Why isn't that in the configuration seams?
Why is the valid port for ssh not registered in the config?

Mon Mar  8 07:17:29 2021 auth.info sshd[2289]: Failed password for root from 192.168.0.3 port 53472 ssh2
Mon Mar  8 07:17:31 2021 auth.info sshd[2289]: Connection closed by authenticating user root 192.168.0.3 port 53472 [preauth]
Mon Mar  8 07:17:54 2021 daemon.err uhttpd[832]: luci: accepted login on / for root from 192.168.0.3
Mon Mar  8 07:19:26 2021 authpriv.warn dropbear[2456]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:26 2021 authpriv.info dropbear[2456]: Early exit: No listening ports available.
Mon Mar  8 07:19:31 2021 authpriv.warn dropbear[2467]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:31 2021 authpriv.info dropbear[2467]: Early exit: No listening ports available.
Mon Mar  8 07:19:36 2021 authpriv.warn dropbear[2471]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:36 2021 authpriv.info dropbear[2471]: Early exit: No listening ports available.
Mon Mar  8 07:19:41 2021 authpriv.warn dropbear[2475]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:41 2021 authpriv.info dropbear[2475]: Early exit: No listening ports available.
Mon Mar  8 07:19:46 2021 authpriv.warn dropbear[2476]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:46 2021 authpriv.info dropbear[2476]: Early exit: No listening ports available.
Mon Mar  8 07:19:51 2021 authpriv.warn dropbear[2477]: Failed listening on '22': Error listening: Address in use
Mon Mar  8 07:19:51 2021 authpriv.info dropbear[2477]: Early exit: No listening ports available.
Mon Mar  8 07:19:51 2021 daemon.info procd: Instance dropbear::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

Have you done any modifications to the freshly installed 19.07.5 configuration?
Does the issue persist with 19.07.7?

What's the output of netstat -anp | grep :22 ?

3 Likes

I only updated the installed software every week.
The installation is about 10 weeks old.

~# netstat -anp | grep :22
tcp 0 0 0.0.0.0:3331 0.0.0.0:* LISTEN 3958/dropbear
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3554/sshd
tcp 0 0 192.168.0.1:3331 192.168.0.164:43054 ESTABLISHED 4930/dropbear
tcp 0 0 :::3331 :::* LISTEN 3958/dropbear
tcp 0 0 :::22 :::* LISTEN 3554/sshd

There's your problem. Dropbear and sshd are conflicting.

sshd is not included in a default installation of OpenWRT. Per @tmomas' earlier question, have you done any modifications to the freshly installed 19.07.5 configuration?

which sshd returns no results on a vanilla installation of OpenWRT. However, if I subsequently install openssh-server without telling the people trying to help me that I've done so, then which sshd returns a result: /usr/sbin/sshd.

So pick either dropbear or openssh-server, but not both.

3 Likes

Tis is on my router installet:

what shud I remove?