fix: always use sudo for agent install (remove fallback check)
The sudo -n check was incorrectly detecting that sudo required a password, causing fallback to plain bash without root permissions. Now we always run the installer via sudo bash, consistent with how all other SSH commands work (systemctl, reboot, etc.).
This commit is contained in:
@@ -51,11 +51,9 @@ class AgentService
|
||||
|
||||
$b64 = base64_encode($script);
|
||||
$remoteCommand = sprintf(
|
||||
'echo %s | base64 -d | (sudo -n true 2>/dev/null && sudo bash -s -- %s %s || bash -s -- %s %s) 2>&1',
|
||||
'echo %s | base64 -d | sudo bash -s -- %s %s 2>&1',
|
||||
escapeshellarg($b64),
|
||||
escapeshellarg($serverUrl),
|
||||
escapeshellarg($agentKey),
|
||||
escapeshellarg($serverUrl),
|
||||
escapeshellarg($agentKey)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user