Useradd: cannot open /opt/etc/group

I am trying to create a new user via SSH in my Openwrt. I have Entware Installed on a USB stick. When running the commmand

useradd -r -s /bin/ash my-new-user

I am getting the following error:

useradd: cannot open /opt/etc/group

How come I can't create a new user with this command and how can I fix this?

Why is "useradd" trying to add groups to the "/opt/etc/group" file?

2 Likes

You might want to make your request here instead: https://github.com/Entware/Entware/issues

This isn't included in OpenWrt by default.

:spiral_notepad: FYI, the Entware README on GitHub is a copy/paste of OpenWrt Wiki pages. It's unclear why they added that text to their README (i.e. adding links for the official forums, the Firmware Selector, bugs, etc.).


It appears you are using firmware that is not from the official OpenWrt project.

When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).

If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.

2 Likes

I haven't the slightest clue. Can you tell me?

What makes you think I am using a fork or unsupported version? The link you provided is the exact link I used to download Openwrt for raspberry pi. I'm almost certain this is an official build.

Your problems are with entware packages, not OpenWrt - so there's very little we could do to support you here.

All i can tell you is that official releases of OpenWrt do not do that by default. So, either you are not using an official release, or you made some changes to make it happen.

1 Like

Just to be clear, The default package manager in OpenWRT IS Entware correct? Just want to be sure we are talking about the same thing, because I am using the default package manager with "opkg" in OpenWRT.

No, it's not.
Entware isn't used by OpenWrt in any way, shape or form, neither by default nor optionally. OpenWrt uses its own variant of opkg, with all packages provided by OpenWrt itself (source and built), downloaded from OpenWrt's servers.

There certainly is a 'similarity' between concepts used by Entware and OpenWrt, but the sources and maintenance are distinct. Any issues you encounter with Entware and its packages are not on-topic here, as OpenWrt can't fix those Entware packages.

--
The primary focus of Entware also doesn't really appear to be OpenWrt (as with OpenWrt, you have full access to the complete source and can package things 'properly'), but more as an addon for semi-proprietary OEM firmware, to allow limited extensions under a different prefix.

2 Likes

Thank you for clarifying this. In that case, I AM NOT USING ENTWARE! I just thought opkg=entware, but now i see its a custom implementation of openwrt's package manager. I am using the default package manager then.

In that case, you still have to explain why is "adduser" trying to write there... Because that is not standard behavior; did you configure it to behave like that? did you install any package not from the official channels?

1 Like

What is the output from

ubus call system board 
1 Like

WOW! You are going to shoot me after this. I've been configuring two routers at the same time. One for a friend and then my own. Turns out, I have been staring at the computer and terminals much too long, because when I was entering the ssh commands, I was actually ssh'd into my friends ddwrt router, and NOT my openwrt router. Sorry for all of the confusion, but thank you for hanging in there with me! I hope you can forgive my mistake!

Anyways, problem solved!

2 Likes

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