mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
For remote control, Linux agent no longer needs to be installed under the account that is set for auto-login.
This commit is contained in:
parent
21ace2fc33
commit
cb055e855d
@ -52,7 +52,6 @@ The following steps will configure your Windows 10 machine for building the Remo
|
||||
* Windows: Only the latest version of Windows 10 is tested.
|
||||
* Linux: Only Lubuntu 18.10 is tested.
|
||||
* Your account must be set to auto login for unattended remote control to work.
|
||||
* The install script needs to be run while the above account is logged in.
|
||||
|
||||
## Session Recording
|
||||
* You can turn on session recording in appsettings.json.
|
||||
|
||||
@ -272,7 +272,14 @@ namespace Remotely_Agent.Services
|
||||
{
|
||||
var users = OSUtils.StartProcessWithResults("users", "");
|
||||
var username = users?.Split()?.FirstOrDefault()?.Trim();
|
||||
var casterProc = Process.Start("sudo", $"-u {username} {rcBinaryPath} -mode Unattended -requester {requesterID} -serviceid {serviceID} -host {Utilities.GetConnectionInfo().Host} -desktop default & disown");
|
||||
var psi = new ProcessStartInfo()
|
||||
{
|
||||
FileName = "sudo",
|
||||
Arguments = $"-u {username} {rcBinaryPath} -mode Unattended -requester {requesterID} -serviceid {serviceID} -host {Utilities.GetConnectionInfo().Host} -desktop default & disown"
|
||||
};
|
||||
psi.Environment.Add("DISPLAY", ":0");
|
||||
psi.Environment.Add("XAUTHORITY", $"/home/{username}/.Xauthority");
|
||||
var casterProc = Process.Start(psi);
|
||||
casterProc.WaitForExit();
|
||||
}
|
||||
}
|
||||
@ -317,8 +324,14 @@ namespace Remotely_Agent.Services
|
||||
{
|
||||
var users = OSUtils.StartProcessWithResults("users", "");
|
||||
var username = users?.Split()?.FirstOrDefault()?.Trim();
|
||||
|
||||
var casterProc = Process.Start("sudo", $"-u {username} {rcBinaryPath} -mode Unattended -requester {requesterID} -serviceid {serviceID} -host {Utilities.GetConnectionInfo().Host} -relaunch true -desktop default -viewers {String.Join(",", viewerIDs)} & disown");
|
||||
var psi = new ProcessStartInfo()
|
||||
{
|
||||
FileName = "sudo",
|
||||
Arguments = $"-u {username} {rcBinaryPath} -mode Unattended -requester {requesterID} -serviceid {serviceID} -host {Utilities.GetConnectionInfo().Host} -relaunch true -desktop default -viewers {String.Join(",", viewerIDs)} & disown"
|
||||
};
|
||||
psi.Environment.Add("DISPLAY", ":0");
|
||||
psi.Environment.Add("XAUTHORITY", $"/home/{username}/.Xauthority");
|
||||
var casterProc = Process.Start(psi);
|
||||
casterProc.WaitForExit();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
2019.04.06.1318
|
||||
2019.04.08.0720
|
||||
|
||||
@ -43,9 +43,6 @@ EOL
|
||||
|
||||
echo Creating service...
|
||||
|
||||
usersArr=($(users))
|
||||
targetUser=${usersArr[0]}
|
||||
|
||||
cat > /etc/systemd/system/remotely-agent.service << EOL
|
||||
[Unit]
|
||||
Description=The Remotely agent used for remote access.
|
||||
@ -54,9 +51,7 @@ Description=The Remotely agent used for remote access.
|
||||
WorkingDirectory=/usr/local/bin/Remotely/
|
||||
ExecStart=/usr/local/bin/Remotely/Remotely_Agent
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
Environment=DISPLAY=:0
|
||||
Environment="XAUTHORITY=/home/$targetUser/.Xauthority"
|
||||
RestartSec=10"
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
||||
|
||||
Loading…
Reference in New Issue
Block a user