Can't install ssh server on custom OpenWrt image (Virtualbbox x64)

I'm trying to build a custom OpenWRT image for different router devices, but for now I want to start building custom image for Virtualbox. However, even a simple ssh service I can't seem to make it work. When I try to install openssh-server pacakge (opkg install openssh-server), opkg says: Unknown package openssh-server. I did opkg update prior to installing openssh-server.

As a background, I'm an experienced linux user and know basic linux stuff in other distros. But this is my first time customizing openwrt image. Any recommendation would be greatly appreciated.

You are aware that dropbear is installed per default as SSH server, yes?

But back to you issue with installing: does opkg update work, it outputs all the feeds it updated.
And could you let us know the output of cat /etc/opkg/distfeeds.conf to show what feeds you did include in your build? The standard ones for my APU2 with the official image are:

$ cat /etc/opkg/distfeeds.conf
src/gz openwrt_core https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/telephony
2 Likes

First of all, thanks for the quick response to my first post on this forum. That was really quick :slight_smile:

You are aware that dropbear is installed per default as SSH server, yes?

To be honest, no. I did not know openwrt uses different ssh server package since I've just started tinkering with openwrt just the other day. I'm used to using openssh-server in every linux distro I've had.

The contents of my /etc/opkg/distfeeds.conf are only two lines:

src/gz openwrt_core https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/base

This may be the reason why I can't seem to install any other packages (including openssh-server). But since you've mentioned dropbear, I will switch to it instead of openssh-server.

I do not want to include luci web modules since I'll be developing my own UI for openwrt.

Any advice how to know and how to configure the dropbear ssh server?

Have a look at OpenWrt Docu: Configure Dropbear.

From the command line you configure most of OpenWrt using UCI (Unified Configuration Interface). This is also used in the docu in the first link.

Edit: in make menuconfig you can choose which feeds to include. Including the package feed should be enough for the most common packages.

1 Like

I will look into dropbear docs and read more openwrt wiki. Thanks mate, that was really helpful. Cheers!

1 Like

And if you want to install packages beyond the base system you will need the packages repository referred above.

1 Like

To summarize the solution to this post, the packages repository must contain the feeds posted by @patient0 in order to install external packages:

$ cat /etc/opkg/distfeeds.conf
src/gz openwrt_core https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/22.03.3/packages/x86_64/telephony

Use dropbear ssh server instead of openssh-server. And in my case, I tried to access SSH service through wan interface that's why I could not connect to my router even though ssh service was running. I was able to access SSH through the lan interface.

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