OpenSSH Access Denied

I use a custom image in which I remove Dropbear, and instead install OpenSSH-Server.

Problem is, I can't sign in no matter what I do. I set my router login password, then try to tunnel:

root
123

As an example. "Access Denied" no matter what I do.

Why is it doing that and how do I get it to accept my credentials?

Openssh does not allow root login by default, at least with password. You need to configure /etc/ssh/sshd_config

1 Like

How do I do that if I can't login?

Either you remove dropbear after configuration or you take backup of your settings and modify the backup file, then "restore" it.

Dropbear is not installed whatsoever by default since my custom image is not built with it, only OpenSSH.

As for the backup file solution, that worked. I had to create the file "sshd_config" in "/etc/ssh/" since it didn't exist.

Then I put "PermitRootLogin yes" in it, saved it, uploaded it, and it now allows me access.

I don't understand why OpenWRT doesn't allow root logins by default with OpenSSH. That's rather irritating. But oh well, thank you!

It is upstream default. You can submit your config patch here if you feel it is wrong.

I don't know how to. :slightly_smiling_face:

Option 1. Use a serial connection.
Option 2. Boot into failsafe mode, mount root, edit files, save, reboot.

You could also just report this as a feature request on the OpenWrt GitHub issue tracker. As it is a rather simple change and does not change behavior in comparison to default dropbear I don't see a reason why this shouldn't be done.

2 Likes

There's a run cli commands luci addon (don't remember the name, sorry) you could try to keep openssh, and customize it via the addon after you've flashed the device.

I could, but I don't have a github account.

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