[SOLVED] Is OpenWrt a single-user OS?

Hi all,

After reading some statements like "OpenWrt is a single-user OS" which are a little bit shocking to me, because I know I can add addgroup/adduser utilities to add other users who can log in, and using sudo those users can perform admin tasks, I hope somebody can make it clear: is OpenWrt a single-user OS?

Some doubts:

  1. If it is a single-user OS, why non-root users can log in instead to get this (su)login prompt I got on other (systemvinit) systems after "telinit 1", which is single-user runlevel?

    Give root password for system maintenance
    (or type Control-D for normal startup):

  2. If it is a single-user OS, why /etc/passwd lists different users?

    root@ekhinea:~# cat /etc/passwd 
    root:x:0:0:root:/root:/bin/ash
    daemon:*:1:1:daemon:/var:/bin/false
    ftp:*:55:55:ftp:/home/ftp:/bin/false
    network:*:101:101:network:/var:/bin/false
    nobody:*:65534:65534:nobody:/var:/bin/false
    
  3. If it is a single-user OS, why kernel_menuconfig "General setup>Configure standard kernel features" does have selected by default "Multiple users, groups and capabilities support", where
    help says:

    ###############################################################
    CONFIG_MULTIUSER:
    This option enables support for non-root users, groups and
    capabilities.

    If you say N here, all processes will run with UID 0, GID 0, and all
    possible capabilities. Saying N here also compiles out support for
    system calls related to UIDs, GIDs, and capabilities, such as setuid,
    setgid, and capset.

    If unsure, say Y here.
    #############################################################

So I would say that OpenWrt is a multiuser OS, but maybe I'm getting it wrong. What would make it a single-user OS while having enabled all these multiuser-looking features?

Please note I'm just asking it because I want to have it clear. Any links to good doc would be helpful

TIA

It has full multiuser support but by default has only the root user in the passwd database. This is probably why some say it's a single user OS.

3 Likes

Runs multi-user quite well.

Home directories can be preserved by sysupgrade by adding them to /etc/sysupgrade.conf

The ROM is built with root:root ownership of everything, but that can be changed by run-once scripts. I recall recently reading a consideration of buildroot or fakeroot or the like to allow generation of ROM images with varied ownership. Edit: http://lists.infradead.org/pipermail/openwrt-devel/2019-January/015560.html

I prohibit root login and use sudo on my boxes. I understand there’s a way to get LuCI to handle users at some level (but don’t use LuCI, in general).

2 Likes

OpenWrt, as an OS, is not single-user, as others have pointed out. However, LuCi, as the web interface for OpenWrt, is not designed to be used in a multi-user environment: you cannot create users and groups, and assign them roles and permissions on different administrative tasks.

2 Likes

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