Answer the question
In order to leave comments, you need to log in
How to remotely run a script on the user's desktop in Linux?
A normal user is on linux (mate + lightdm installed, maybe that matters), there is a .sh script on the desktop that first asks for a password to connect to an RDP server (using zenity) and then calls freerdp. The task is to run this script remotely via ssh while logged in as root at the right time. That is, he remotely entered a command in the terminal of his laptop, and the user had a password entry window.
Please help me solve this problem in this way, without schedules, replacing the script with other RDP clients, etc.,
Answer the question
In order to leave comments, you need to log in
Much depends on the distribution and software versions.
With lightdm, the Xauthority file can be anywhere for the user.
For example, in /home/$user/.Xauthority, or maybe somewhere in /run/lightdm/$user/Xauthority
or /run/$userid/lightdm/Xauthority
As an example, but this is for Gnome with GDM.
XAUTHORITY=/run/user/1000/gdm/Xauthority DISPLAY=:0 sudo -u wedmer gedit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question