Score:0

How to create a non-admin user in OpenBSD to be able to login as a root like in Linux-based systems?

cn flag

Usually, in Linux-based systems I create new user without admin rights (sudo group).

I'm able to login as that user via SSH and then, when I need admin rights, I can just,

$ su root
...entering pwd...
# whoami
root

In OpenBSD I can't login as a root via 'su' command, because only users in 'wheel' group can do that.

But 'wheel' group in OpenBSD system means the same as 'sudo' group in Linux.

Is there any way I can do the same thing in OpenBSD?

I want to be able to log in as a user with as minimum rights as possible and then re-log as a root, if needed.

vidarlo avatar
ar flag
Have you read [the fine documentation](https://www.openbsdhandbook.com/system_management/privileges/)?
Egor Kokorin avatar
cn flag
yes I do. there are several ways to allow a user to make a calls like a root – via 'doas' command, via 'sudo' package installation and, the last one, is using 'su' from a user within 'wheel' group. That ways are not the way I wrote about. Using this methods I have to, 1. for 'doas' – I have to permit a user to act like a root. So, this user can do anything via 'doas' command. Not what I'm looking. 2. for 'sudo' – I have to add a user to a 'wheel' group. So, that user can act like a root. Not what I'm looking again. 3. for 'su' – I have to add a user to a 'wheel' group too.
Egor Kokorin avatar
cn flag
In Linux I can have user without any rights. I can't use 'sudo' commands because I'm not in any admin group. I can't elevate privileges via vim or any other software (similar to 'doas' command). The only thing I can is to relogin as root (using current user without rights) and do what I need to do.
Egor Kokorin avatar
cn flag
Looks like the only way to do it is to create a thirt user in 'wheel' group. The first user will be used for ssh connection. Using it I'll be able to relogin as the third user (which has 'wheel' group) and then I can use 'su' command or any else method from the faq to act like a root.
Egor Kokorin avatar
cn flag
It doesn't feel secure, it feels strange.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.