Wanting to SSH to Router, need opkg?

I want to connect to my router via ssh, and I get Connection refused. I went around the OpenWRT website, and I see how things can be installed with opkg, so I went to the browser command GUI (router -> Administration -> Commands), and I try it out. This comes up sh: eval: line 1: opkg: not found, so I connected to the router via telnet, and tried to run opkg again, and it just says -sh: opkg: not found. How do I install packages/SSH/use opkg??? I'm quite confused with this "ash" shell, and I haven't been able to find help through Google, OpenWRT Documentation, or by quickly searching this forum.

dropbear (the default sshd) is always preinstalled (in all official OpenWrt firmware images. unless you very explicitly disable it from being built into the firmware); opkg is not necessary for ssh, but obviously if you do want to install additional packages.

Do you know at least, why the connection is being refused? The router is IP 10.0.0.2, and I have tried ssh root@10.0.0.2 and ssh 10.0.0.2.

The only reason for that would be that one of your configuration changes disabled dropbear, either explicitly or as an unintended side-effect; welcome to failsafe_and_factory_reset.

I don't even know what dropbear is :p. My setup is pretty basic I would assume I haven't disabled anything, but I'll look into it.

What version of OpenWrt are you running? telnet hasn't been supported for a few years now, as I recall.

ash is a variant of sh. It is not bash -- which is what many in the Linux world mistakenly call "sh". Any introductory text on use of sh is likely applicable, as long as you keep in mind that there are differences with bash. It's hard to recommend one tutorial over the others as everyone learns differently.

I think, telnetd is active, because he ran firstboot or he didn't set the password.

Telnet server was taken out entirely years ago, version 15 I think. You can't telnet to a modern version they only support SSH.

1 Like

Perhaps I am asking the obvious, but did you even install OpenWrt in that router? Which version? Have you changed any of the settings?

1 Like

Hopefully all involved users see this reply, anyhow:
The Router (call it R1) I was trying to ssh into, I figured out it doesn't have support for that, because on another Router I have (call it R2), the settings were found, but they weren't on R1. However even when SSHing to R2, it was still running ash.

I've got SSH working now I suppose, so what I want to know then, is how/where to use opkg?

and @eduperez yes I have OpenWrt installed...

If anyone wants to know what I use these 2 routers for, they are daisy chained to my PC, and they are used mainly for local network resources in my game room, however they can be used to access the internet, since on my PC, I have my Ethernet and WiFi bridged.

Well I feel retarded.
Sorry for wasting everyone's time.

I wasn't aware that OpenWRT and DD-WRT were different projects...

On that topic though, are there any reasons to use OpenWRT over DD-WRT? Maybe not the best forum for an unbiased answer but oh well lol.

1 Like

One major reason:

  • DD-WRT hasn't been updated in 10 years
1 Like

oof, yeah that's a pretty good reason then.

Does OpenWRT have most or all of the same features? Or at least, the minimum I need for the setup I described?

I won't say that it's an "unbiased opinion", but for me:

  • OpenWrt, for the non-Broadcom wireless devices I use (Broadcom CPUs seem to be well supported, just not the wireless chipsets)
    • Has been rock-solid for years
    • Has a build environment that allows me to easily customize the images to my own needs
    • Since the LEDE project split (and later merge), has been very up-to-date with security patches and current packages
  • DD-WRT
    • Works well for Broadcom-based wireless devices; I have not confirmed that DD-WRT has "special licensing agreements" with Broadcom, but that is what I have read here
2 Likes

I don't know much about routers, the different brands, and what kind of hardware they have, but when you say Broadcom based, does that apply to routers like the Linksys WRT54G?

In my opinion, it has more, especially since OpenWrt has a large repository and package management.

SSH is installed and enabled by default in OpenWrt - password is blank on first boot.

1 Like

The "famed" Linksys WRT54G has long faded from supportability under both OpenWrt and DD-WRT -- it just doesn't have enough resources to manage a current kernel and application software. Not to mention any of the current 802.11 protocols.

Models to "avoid" for OpenWrt due to Broadcom wireless hardware include those on the Table of Hardware (ToH) that show "Broadcom" in the wireless column, or have notes about wireless not working. If the model you have or are considering isn't listed as supported in the ToH, or listed at all, it won't be "turn key" to install OpenWrt.

My model isn't even on that list... weird.
I have a WRT54G v5

I also have a WRT160N v3, which shows as having Broadcom on the list. Is it not possible to install an older version of OpenWRT that does work on it?

https://wikidevi.com/wiki/Linksys_WRT54G_v5.0

It's a 2005 device, that didn't ship with Linux. The wireless protocols are wildly out of date (802.11n was 2009) and can't be updated. With 2 MB of flash and 8 MB of RAM, it's pretty much unsupportable.

There are many suggestions and opinions of inexpensive (US$20 or so) devices that can make you much more secure, faster (in 2005 a 56k modem was pretty fast, not the 1,000,000 kbps lines available at consumer-friendly prices), and a lot easier to configure in the long thread

1 Like