Given a standard Fedora KDE 44 installation, I have a user that resents passwords, so his/her account is passwordless, i.e.
passwd -d $user
was run for the $user account.
But I still need this user to be able to perform administrative tasks (use Discover for upgrades, mount USB pens or disks, for instance), so I need to protect his/her becoming root in some way.
sudo is not appropriate for this, as it requests the user’s password, which is none, so it carries on with the given task without any question su on the other hand, which would be the logical choice, is not on SELinux’s liking. I have to keep SELinux in permissive mode, but It produces an annoying warning (about “chkpwd” or something).
Any ideas, other than disabling SELinux altogether?
sudo is not appropriate for this, as it requests the user’s password
You can use NOPASSWD for this specific user in /etc/sudoers and list what commands they can run via sudo and without entering a password. Will that work?
I need the user to be able to execute anything as root, as I do not want to introduce exceptions by hand in the sudoers file(s) each time the user encounters a legitimate need. The machine belongs to that person, I have to let them him/her do whatever they want but just cannot let him/her become root without any sort of guard. And that goes even if I allowed them to execute only certain commands.
This will cause sudo to ask for the root password instead of the user’s password.
Thanks, I’ll try this and get back. But then what would be the difference between sudo su - and su? Actually, isn’t the correct solution to convince SELinux to allow su?
The “correct” thing to do, would be to just set a password for the user account and then use sudo as normal. Or you can activate the root account and allow them to su - to root and execute whatever commands they need.
You are overly complicating this by allowing the user to have no password set, and then trying to create a Rube Goldberg machine to force a password prompt when elevating permissions.
I suppose your other options would be to look at pkexec or run0, but I suspect you’ll have similar issues there.
You may set a password for the user account with sudo permission, but also set the system to “automatically log in” so normal computer users won’t be asked for user password (only when they do something that requires root).
This is an article about how to do it on Ubuntu, I expect it to be similar on Fedora though:
Note that this setup comes with certain caveats, most importantly the desktop environment won’t be able to unlock the user keyring automatically in this case, unless provided with user’s password or the password is blank (insecure).
su should work with SELinux on enforcing mode, if root password is set. If that isn’t the case… I don’t know what exactly happened to your computer, but it seems to be very wrong.
After reading all of the current posts here, I am inclined to say to that user that resents passwords “Get over yourself!!” Particularly if this “resentful” user is to do any kind of admin task … UNLESS … that “resentful” user is the actual owner of the device (then I would just refuse to support them after the install without charging them some ungodly amount of money as a support fee)…