Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Linux, run with sudo or equivalent, instead of the root account #950

Open
audreytoskin opened this issue Jun 23, 2020 · 4 comments
Open

Comments

@audreytoskin
Copy link
Contributor

audreytoskin commented Jun 23, 2020

On GNU/Linux, installing BleachBit adds an extra entry to the system apps list, so you can run BleachBit normally or with admin privileges. Using this .desktop app entry, or else calling the bleachbit-root executable, seems to ask for the password for the literal root account instead of the invoking user's account.

However, some Linux distributions, such as recent releases of Fedora, lock the root account by default, never setting a password at all (for a security benefit, I assume). So, even su root must be invoked from sudo, with the sudoer's password.

A simple workaround for the user would be to open a terminal and run sudo bleachbit instead. But on Fedora, the "BleachBit As Administrator" app entry is sorta pointless unless or until the user manually sets a root password.

I'm not sure how common default passwordless root accounts are among the various Linux distributions, but it might still be better and more flexible to elevate to admin privileges using some GUI equivalent to sudo --- pkexec, etc. Of course, that comes at the cost of adding an extra dependency.

@az0
Copy link
Member

az0 commented Jun 25, 2020

Recently I haven't looked at all this, but four years ago, we added PolicyKit. The original ticket is here https://bugs.launchpad.net/bleachbit/+bug/1111061

The policy is skipped with the rpm and deb packages found on https://www.bleachbit.org

Are you using Fedora? Did you install BleachBit from the Fedora repository or from www.bleachbit.org ?

@audreytoskin
Copy link
Contributor Author

Yes, I'm using Fedora 32 Workstation edition, x86_64. I'm still working on repackaging BleachBit for the Fedora repos, so I'm building BleachBit 4.0.0 from source, comparing each step in my RPM spec with the spec that you use to build on OSBS... Although I get the same results when installing the official bleachbit-4.0.0-1.1.fc31.noarch.rpm package from bleachbit.org too.

When launching from a terminal:

↪ bleachbit-root
You are attempting to run "bleachbit-root" which requires administrative
privileges, but more information is needed in order to do so.
Authenticating as "root"
Password: 
Password: 
Password: 
The password you typed is invalid.
Please try again.

<exit code 1>

Authenticating as root fails, because root does not have a password for regular login, by default. And entering my regular user password fails (even typing into a text editor so I can see the correct spelling, and then copy/pasting into the terminal), because it seems to actually be authenticating as the root account instead of using sudo or equivalent.

@audreytoskin
Copy link
Contributor Author

Maybe another reason to change the admin password implementation: Launching BleachBit As Administrator via the system app menus (in GNOME Shell, the "Task Overview") never actually prompts me for a password at all. Immediately after trying to launch "BleachBit As Administrator" I can see the process /usr/sbin/userhelper -t -w bleachbit-root running briefly, but there's never a password dialog, and the process exits after maybe 10 seconds or so.

I hadn't mentioned this in my original post, because I assumed this part was a problem with my package spec, but after reinstalling the bleachbit.org package, I can confirm there is still never any password prompt.

If I manually set a password for root, using sudo passwd root, then bleachbit-root from the command line works with that password, but BleachBit As Administrator from the system apps list still silently starts and exits after a few seconds.

@soredake
Copy link

soredake commented Jul 3, 2020

Maybe better to do this actions in main program that require root with kdesu (or something like this) instead of separate bleachbit-root? It's inconvenient to have two versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants