r/AlpineLinux • • Sep 22 '22

disable su

Is there any way to prevent users from using the su command within /etc/doas.d/doas.conf?

0 Upvotes

6 comments sorted by

View all comments

2

u/[deleted] Sep 22 '22

What are you trying to accomplish? Even if you can do that, nothing is stopping said user from then opening a shell with doas that is effectively just the su command.

-2

u/[deleted] Sep 22 '22

Opening a shell with doas requires that a user is in the wheel group, whereas any user can use su to become a user in the wheel group.

5

u/[deleted] Sep 22 '22

You should not be able to use su to "become" a user you don't have the password for. This is the same as a regular login. If you can, your PAM config is wrong. If you were already aware of this, you will see that at any point if you have root access you can modify the basis of your access, meaning (without MAC) it doesn't matter what restrictions you try to apply.

2

u/[deleted] Sep 22 '22 edited Sep 22 '22

busybox su on alpine linux does not use PAM at all.

https://gitlab.alpinelinux.org/alpine/aports/-/issues/11730

1

u/[deleted] Sep 23 '22

Damm, that’s… awful.