fix: send ssh username to guacd (default root) for console SSH

This commit is contained in:
2026-07-17 11:54:33 +01:00
parent 50907448d2
commit 1ad5b5d6db
6 changed files with 43 additions and 5 deletions
+10
View File
@@ -19,6 +19,7 @@ export default function ServerConsolePage() {
const [protocol, setProtocol] = useState<string>(searchParams.get("protocol") || "");
const [keyId, setKeyId] = useState<string>("");
const [sshUsername, setSshUsername] = useState<string>("root");
const [rdpUsername, setRdpUsername] = useState("");
const [rdpPassword, setRdpPassword] = useState("");
const [connecting, setConnecting] = useState(false);
@@ -72,6 +73,7 @@ export default function ServerConsolePage() {
};
if (protocol === "ssh") {
body.key_id = keyId || undefined;
body.ssh_username = sshUsername || undefined;
} else if (protocol === "rdp") {
body.rdp_username = rdpUsername || undefined;
body.rdp_password = rdpPassword || undefined;
@@ -152,6 +154,14 @@ export default function ServerConsolePage() {
{protocol === "ssh" && (
<div>
<label className="mb-1.5 block text-sm font-medium text-text-secondary">SSH Username</label>
<input
type="text"
value={sshUsername}
onChange={(e) => setSshUsername(e.target.value)}
placeholder="root"
className="mb-3 w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-accent/50 focus:outline-none focus:ring-1 focus:ring-accent/30"
/>
<label className="mb-1.5 block text-sm font-medium text-text-secondary">SSH Key</label>
<select
value={keyId}