mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-02 19:26:56 -05:00
gui window for ask user password not everywhere work (polkit not work on hardened Linux) #1207
Labels
No labels
bug
documentation
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
question
unreproducible
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rustdesk-rustdesk#1207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @1223421 on GitHub (Jan 7, 2023).
Describe the bug you encountered:
I can't change settings
What did you expect to happen instead?
change settings
How did you install
RustDesk?github night release rustdesk-1.2.0-0-x86_64.pkg.tar.zst
RustDesk version and environment
1.2.0-0
Gentoo, xfce4.
gui window for ask user password not everywhere work, and this is really bad idea, i don't want write my password for change settings, it's bad.
@rustdesk commented on GitHub (Jan 7, 2023):
@21pages need to test on xfce, or even gentoo xfce4.
@21pages commented on GitHub (Jan 7, 2023):
Input correct password and not pass or permission messagebox not pop up? What about typing
pkexec echoin terminal?github.com/rustdesk/rustdesk@e9e8620145/src/platform/linux.rs (L678)@1223421 commented on GitHub (Jan 8, 2023):
OK, i am fixed my problem by turn on this in autorun settings:

But i really think this is bad idea -- ask password for this. You ruin a great program by this:(
@rustdesk commented on GitHub (Jan 8, 2023):
@21pages can we check if this is turned on and ask users to turn it on?
@1223421 commented on GitHub (Jan 8, 2023):
This is start "/usr/libexec/polkit-gnome-authentication-agent-1" in user session, maybe you can check it, this is turn on by default, this is i turn off because i don't need it...
@rustdesk commented on GitHub (Jan 8, 2023):
Why do you turn it off?
@1223421 commented on GitHub (Jan 8, 2023):
i am paranoid 🙃
@rustdesk commented on GitHub (Jan 8, 2023):
Perfect.
@21pages commented on GitHub (Jan 8, 2023):
check polkitd daemon process
https://www.freedesktop.org/software/polkit/docs/latest/polkitd.8.html
@rustdesk commented on GitHub (Jan 8, 2023):
@21pages let me handle this
@rustdesk commented on GitHub (Jan 8, 2023):
@1223421 commented on GitHub (Jan 8, 2023):
$ ps ax | grep polkit
839 ? Ssl 0:01 /usr/lib/polkit-1/polkitd --no-debug
52287 ? Sl 0:00 /usr/libexec/polkit-gnome-authentication-agent-1
polkitd -- start by root(systemd)
/usr/libexec/polkit-gnome-authentication-agent-1 -- user
@rustdesk commented on GitHub (Jan 8, 2023):
@143981 Thanks, how about if you turn polkit off?
@rustdesk commented on GitHub (Jan 8, 2023):
turn this off
@1223421 commented on GitHub (Jan 8, 2023):
Turned off and systemctl stop polkit, so everything is the same as in the first message
started by itself
$ ps ax | grep polkit
132653 ? Ssl 0:00 /usr/lib/polkit-1/polkitd --no-debug
132689 pts/8 S+ 0:00 /usr/lib/polkit-1/polkit-agent-helper-1 user
if i "mv /usr/lib/polkit-1/polkitd /", then nothing happens when pressing the button in rustdesk
@rustdesk commented on GitHub (Jan 8, 2023):
polkitd process is still there when you turn off policykit auth
@1223421 commented on GitHub (Jan 8, 2023):
if i "mv /usr/lib/polkit-1/polkitd /", then nothing happens when pressing the button in rustdesk
@rustdesk commented on GitHub (Jan 8, 2023):
Not find a good way to know if policykit auth turned on or off.
@1223421 commented on GitHub (Jan 8, 2023):
I repeat - this is a bad idea initially, it's better to disable it completely in linux, leave it for windows ...
@powerman commented on GitHub (Feb 8, 2023):
Yesterday I've installed nightly (because I need "Always connect via relay" feature to work around disconnects/timeouts every 15 seconds) and have same issue.
polkit-{gnome,kde}-authentication-agent:/usr/libexec/polkit-gnome-authentication-agent-1 &in~/.fluxbox/startupbut it turns out it fails to start - more details below).I'm second one for leaving this "unlock security" feature to Windows users, configuration of usual user-space app shouldn't require
sudo-like-ish on *NIX systems.I've tried to manually run
/usr/libexec/polkit-gnome-authentication-agent-1but got this error:It turns out this error happens because of "hardened" system configuration: mounting /proc with
hidepid=2option. Here is open (3 years ago) bugreport on polkit: https://gitlab.freedesktop.org/polkit/polkit/-/issues/79.While I'm not going to remove
hidepidoption just because of rustdesk anyway, I've tried this just to find out is it helps… This way I get polkit window asking for my password, but… you won't believe but I can't enter it there - my password contains some special chars which can't be entered in such a naıve GUI form as used by polkit (other tools, e.g.ssh-agentor consolepasswd/sudo/etc., handle it without issues). After changing my password to less strong by removing such special chars everything worked okay.Resume. This "security" feature is actually incompatible with real "hardened" Linux systems. Please remove it!
@rustdesk commented on GitHub (Feb 8, 2023):
@21pages let's take note of this.
@rustdesk commented on GitHub (Feb 8, 2023):
PR is welcome
@kwisatz commented on GitHub (Feb 20, 2023):
Same results as @powerman using
awesomewindow manager onDebian 11:I have not consciously done any hardening of my system.
@rustdesk commented on GitHub (Feb 20, 2023):
ChatGpt.
@kwisatz commented on GitHub (Feb 20, 2023):
;)
I don't seem to have any
rules.ddirectory, but neither do any of my colleagues for whom thepkexeccommand works.And these results are consistent with what we've seen above:
I'm guessing that in my case, the problem is not a hardened system, but a potentially incomplete
polkitinstallation or an incompatibility with theawesome(sic!) window manager. I will look into that, sorry I mistook that for a rustdesk issue.I'll leave this here for others to read before posting the same thing unless you'd prefer me to delete both comments?
EDIT: Turns out,
polkitneeds an authentication agent helper utility running in the background which wasn't the case for me (not using a desktop environment). One option is thus to install and then start one of the agent tools with your window manager, e.g.@rustdesk commented on GitHub (Feb 23, 2023):
Got from chatgpt, @21pages try it out, including the same issue on mac.
and below is not greyed.
@SiddheshKukade commented on GitHub (Jun 14, 2023):
@rustdesk Hello, I'm coming from here https://github.com/rustdesk-org/Octernships_Project and the README suggested this link as resource. My question is that Is this the task that we have to solve during the github Octernship ?
@rustdesk commented on GitHub (Jun 14, 2023):
Yes, but this is a simple task, you will have more challenging job to do.
@SiddheshKukade commented on GitHub (Jun 14, 2023):
@rustdesk where can I find these tasks ?
@rustdesk commented on GitHub (Jun 14, 2023):
https://github.com/rustdesk/rustdesk/discussions/918
@me-vmhsi commented on GitHub (Jun 14, 2023):
Hi @rustdesk
This would be my first open source project.
So I wanted to know whether we should complete this task below
Elevate priviledge to run ls -la /root/ with Rust, and print the result on the Flutter window
or take a task from #918 ?
Suggestions would be helpful
Thank you
@rustdesk commented on GitHub (Jun 14, 2023):
Octernships_Project is an exam for applying for GitHub Octernship.
@Srishti-j18 commented on GitHub (Jun 16, 2023):
Hello @rustdesk !!

I am setting up for the assignment
"Elevate priviledge to run a Linux command with Rust"from the this github readme file as suggested in the Project ..My question is that
As this suggested to install Android NDK 22 but in the given link these are unsuppported version and it's suggesting to install current release NDK 25 ..
Please clarify which version I should download..?
@R-ohit-B-isht commented on GitHub (Jun 17, 2023):
@rustdesk the pr is supposed to be merged by the teacher right ?
@spaul-12 commented on GitHub (Jun 20, 2023):
@rustdesk I have completed the assignment task and created the pull request. should I merge the changes into main branch (instructions regarding this is not clearly mentioned)?
@rustdesk commented on GitHub (Jun 20, 2023):
The private one.
@spaul-12 commented on GitHub (Jun 20, 2023):
@rustdesk yes i have created a pull request in the private repo. So should I merge it (as it is showing option to merge the branch into main)?
@rustdesk commented on GitHub (Jun 20, 2023):
No
@c1tyguide commented on GitHub (Jun 28, 2023):
I had the same problem with polkit.
Describe the bug you encountered:
I can't change settings
What did you expect to happen instead?
change settings
How did you install RustDesk?
github night release rustdesk-1.2.0-0.x86_64-suse.rpm
RustDesk version and environment
1.2.0-0
Leap15.4, xfce4.
Solved it by starting app this way:
xdg-su -c rustdesk
@rustdesk commented on GitHub (Jun 29, 2023):
Can you try out below and tell me the result.
@c1tyguide commented on GitHub (Jun 29, 2023):
pkexec echo x; echo $?;
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/echo' as the super user
Authenticating as: root
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized
This incident has been reported.
127
@rustdesk commented on GitHub (Jun 29, 2023):
Please run this in a Desktop env. gnome terminal or the other gui terminal.
@c1tyguide commented on GitHub (Jun 29, 2023):
The same:


But if I start terminal with xdg-su -c it works:
@rustdesk commented on GitHub (Jun 29, 2023):
How about if your run
xdg-su -c echo; echo $?? Please test both clicking on cancel and clicking on yes after entering password.@c1tyguide commented on GitHub (Jun 29, 2023):
@basncy commented on GitHub (Oct 12, 2023):
open a new terminal, execute and input password here
pkttyagent --process $(pidof rustdesk)if failed, pkill rustdesk and start over again.
@bones0 commented on GitHub (Feb 20, 2024):
I get "Connection refused" when trying to connect to my Debian 10.13 Linux PC (3.16.0-4-amd64 1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux) in xfce4. So I tried to stop the service and start it again at the Rustdesk GUI on said PC. The Stop-Button has no effect.
I have the password prompt if I run rustdesk 1.2.3 from the terminal in my debian linux. But it does neither accept the root-password nor the user-password (sudo would be allowed) If I run polkitd in another terminal I get the following combination of errors (Let's assume my username is "user"):
Rustdesk:
/bin/systemctl
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/sh' as the super user
Authenticating as: user,,, (user)
Password:
==== AUTHENTICATION FAILED ===
polkitd:
Invalid Locale "en_US.UTF-8"
My system indeed is not running on en_US.UTF-8. It's on de_CH.UTF-8.
I was able to connect to rustdesk once. But I guess that was before the reboot and another source of trouble may be that I am already connected using xrdp and the Windows Remotedesktopclient via another tunnel already. xfce4 seems to have a problem to share sessions with multiple remote-applications.
I run policykit as root with /usr/lib/policykit-1/polkitd -r. The gnome-agent does not exist in my system and polkit-agent-helper-1 requires an argument but does not tell me which one. Since I get some reaction when running polkitd -r I guess that's not entirely wrong. But it may be worth a try to use the helper. But having to run rustdesk from the terminal in order to enter passwords there is not really the expected level of usability anyway.
I have seen the discussion about the "unlock security" button not working. Did not find the link, though. But I get the same authentication-prompt when clicking this button. My workaround there was downgrading to 1.2.1 where this button works, do the settings and then re-upgrade to 1.2.3. But, well, now I have "connection refused". Also with 1.2.1, but I did the analysis with 1.2.3.
@bones0 commented on GitHub (Feb 20, 2024):
https://github.com/rustdesk/rustdesk/issues/2756#issuecomment-1759622483 works as a workaround. And stopping the service and starting it again solved my connection issues. Which are a different ticket anyway.
@rustdesk commented on GitHub (Aug 17, 2024):
We have
PINsupport now (1.3.0).sudo rustdesk --set-unlock-pin <pin>, later you use thePINinstead of polkit.github.com/rustdesk/rustdesk@8a70932cd6/src/core_main.rs (L322)