diff --git a/app/Services/FleetService.php b/app/Services/FleetService.php index 7a48792..8c221f1 100644 --- a/app/Services/FleetService.php +++ b/app/Services/FleetService.php @@ -130,12 +130,17 @@ class FleetService try { $ssh = (new SshClient($this->vault, timeout: 10))->connect($server); try { - [, $code] = $ssh->run('true'); + // A successful login (connect() throws otherwise) already proves the + // credential; running a trivial command also exercises the exec channel. + // Do NOT gate on the exit code: some SSH servers omit the optional + // exit-status packet, so getExitStatus() returns false even on success — + // reaching here without an exception is proof enough. + $ssh->run('true'); } finally { $ssh->disconnect(); } - return ['ok' => $code === 0, 'error' => null]; + return ['ok' => true, 'error' => null]; } catch (Throwable $e) { return ['ok' => false, 'error' => $e->getMessage()]; }