Su, useradd, userdel, groupmod...?

Hi
Do these commands work in Haiku? if so, how do they work?
I tried to use them, but all get is the “usage” description over & over again no matter what options i choose.

Haiku is not a multi-user system.

They work as usual.

“useradd foo” adds the user “foo”
“su foo” switches to the user “foo” and creates a bash shell under his name

There isn’t much you can do in terms of multi user experience, however. So the main use for this is creating the “sshd” user for the SSH daemon, which somehow thinks it needs to run as this specific user. You can’t really have different users with different home directories (and desktop, and settings, and …) at this point. Doing this would require quite a lot of changes and we decided to delay it to after Haiku R1 is completed.

3 Likes

Thanks for the clarifications, i wasn’t really looking for a multi user experience, i was just curious about the su command wether one could use it to make changes to the system dirs?

1 Like

Nope, they are packaged and just virtually extracted.

Ok, thanks, i never really tried to understand how the PM was introduced.

The default user “user” is already root on the machine. You have access to everything.

The read-only /system is not there to troll and have fun of users, it is a technical restrictions and is there for good reasons. Basically, we never extract the files from the packages, instead, we make a virtual filesystem made of the package contents. This mean writing to a file would have to live-modify the matching package, which is quite complex to do and would hinder performance (and make it easy to break your system in hard to fix ways).

You can use two systems (combined) to workaroudn the limitation:

  • You can blacklist files from packages so they are not visible anymore
  • You can put files in the /system/non-packaged, and most system components will search there first (for drivers, libraries, etc).

Hum…, that makes the su command thus useless! right?

For end-users, yes in most cases. At this point the user support is only there for testing purposes.

“su” in UNIX is for “switch user”, and can be used to switch between different user accounts you created. Not only to get access to the “super user” (root) account. So you can switch between different users, but they all have less permissions than the default one.

Ok, thanks for taking the time to explain.

Bash says on attempt of PKGBUILD: Permission denied.

No default pw documented. expectation was raised however.
Specified as not needed and it being single user system.
login: root
password: [ defaultlist from human brain tested ]
Login failed.
The user is not root. What is this?

Welcome to the Haiku shell.

~> whoami
user
~> 

There’s nobody named “root” on a Haiku system. The user is in charge.

In Haiku you are logged as the single user “user”.

There are some directories that are read-only because they come from package files. No amount of sudo or changing permissions will help with that (similar to a filesystem being mounted read-only). Probably your PKGBUILD tried to write into these directories and this explains the error you got? Hard to say without more info about which file or path triggered that error.

true no named user root found.
group root exists, and user is not a member.
… or ARE we ?
In Linux, files in /home/user are of owner/group user
Group user seems not to exist in Haiku?
For get-info on files in /home, the labels and names:
Owner user, Group root.
Expected is Group user for files in /home.
Understand logic for Group root in /system.
For files in /home, cannot set Group to user, instantly resets to root.
Admitted I have octal permissions to learn about.
#/boot/bin/bash is of Owner user indeed, Group is root as expected.
In anyBuntu /bin/bash is owned by the user-named-root and the group root.

Haiku is not Linux, but bring posix and other frames…

Link to Distrotubes gitlab, clone the shell-color-scripts.
The makefile mentions var and opt directories. Can understand some errors in these folders. Files in folders on homedrive are of Group root.

… “su” not to be confused with the “superuser”,
known from the (mis?) understood te be a related command
“sudo” meaning superuser-do. (Unix, Linux, BeOs, posix, Haiku’s… )

Ummm… Do you realize that /opt/ doesn’t exist on Haiku and cannot be created? You need to find the equivalent directory elsewhere.

ummm, yeah also nmtui and nmcli dont exist
sure you can dlelet always on wifi device in system settings network.
even saves the file. Doesn’t shut the wifi down.
1 the unobtainability of source 2 the group root 3 wifi always on.
Back to the vm’s, cannot expose hardware and network to unkowncorp.
The theme is being the boss on own machine. much sorries

As a long-time Haiku user let me give you my 2cent hint: The earlier you accept the fact Haiku is not your everyday unix system, the happier your stay will be. Just let it go.

5 Likes

There is a single user called “user” and a single group called “root”. They don’t have to have the same name even if that’s what Linux does. We’re not Linux and so, some things are different. You don’t even need to touch these permissions anyway, the user “user” can do everything already.

2 Likes