diff --git a/docs/api.md b/docs/api.md index 74e9541..d3fb03d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -206,7 +206,7 @@ The `jump_hosts` array defines an ordered chain of SSH bastion hops. Each hop co | `session_type` | string | All | `ssh`, `rdp`, `vnc`, `spice`, `proxmox`, `web`, or `vdi` (required) | | `hostname` | string | SSH, RDP, VNC | Target hostname or IP | | `port` | integer | SSH, RDP, VNC | Target port (defaults: SSH=22, RDP=3389, VNC=5900) | -| `username` | string | SSH, RDP | Username for authentication | +| `username` | string | SSH, RDP, VNC | Username for authentication (VNC: only for servers with username auth, e.g. VeNCrypt, RealVNC, macOS) | | `password` | string | SSH, RDP, VNC | Password (VNC uses this as the VNC password) | | `private_key` | string | SSH | OpenSSH PEM private key | | `generate_keypair` | boolean | SSH | Generate an ephemeral Ed25519 keypair | @@ -553,7 +553,7 @@ Create a connection entry. The body includes a `name` field plus all entry field | `type` | string | All | `ssh`, `rdp`, `vnc`, `spice`, `proxmox`, `web`, or `vdi` | | `hostname` | string | SSH, RDP, VNC | Target hostname or IP | | `port` | integer | SSH, RDP, VNC | Target port | -| `username` | string | SSH, RDP | Username | +| `username` | string | SSH, RDP, VNC | Username | | `password` | string | SSH, RDP, VNC | Password | | `private_key` | string | SSH | OpenSSH PEM private key | | `url` | string | Web | Target URL | diff --git a/docs/overview.md b/docs/overview.md index ba6e501..06dacb2 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -99,7 +99,7 @@ Supports optional [multi-hop SSH tunnel chains](#ssh-tunnel--jump-hosts) and [Ke ### VNC -Connects guacd to a target VNC server. Supports password-based authentication. Useful for accessing existing VNC servers on the network (e.g., KVM/IPMI consoles, remote desktops, virtual machine displays). +Connects guacd to a target VNC server. Supports password-based authentication, plus username + password for servers that require it (VeNCrypt, RealVNC, macOS Screen Sharing). Useful for accessing existing VNC servers on the network (e.g., KVM/IPMI consoles, remote desktops, virtual machine displays). Supports optional [multi-hop SSH tunnel chains](#ssh-tunnel--jump-hosts) to reach VNC targets through bastion hosts. diff --git a/src/guacd.rs b/src/guacd.rs index a23b86e..eb2fe44 100644 --- a/src/guacd.rs +++ b/src/guacd.rs @@ -98,6 +98,8 @@ pub struct SshParams { pub struct VncParams { pub hostname: String, pub port: u16, + /// Only used by servers with username auth (VeNCrypt, RealVNC, macOS). + pub username: Option, pub password: Option, pub color_depth: Option, pub width: u32, @@ -322,6 +324,7 @@ pub async fn connect_and_handshake( "width" => p.width.to_string(), "height" => p.height.to_string(), "dpi" => p.dpi.to_string(), + "username" => p.username.clone().unwrap_or_default(), "password" => p.password.clone().unwrap_or_default(), "color-depth" => p.color_depth.map_or("24".into(), |d| d.to_string()), "cursor" => "local".into(), diff --git a/src/session.rs b/src/session.rs index 094f4ae..2099a21 100644 --- a/src/session.rs +++ b/src/session.rs @@ -1135,6 +1135,7 @@ impl SessionManager { let params = guacd::ConnectionParams::Vnc(guacd::VncParams { hostname: connect_host, port, + username: req.username.clone().filter(|u| !u.is_empty()), password: req.password.clone(), color_depth: req.color_depth, width, @@ -1436,6 +1437,7 @@ impl SessionManager { let params = guacd::ConnectionParams::Vnc(guacd::VncParams { hostname: "127.0.0.1".into(), port: 0, // placeholder — updated after browser spawn + username: None, password: None, color_depth: None, width, diff --git a/static/connections.html b/static/connections.html index ca3405c..bb5799c 100644 --- a/static/connections.html +++ b/static/connections.html @@ -609,6 +609,9 @@

New Entry

+ @@ -624,7 +627,7 @@

New Entry

-
When enabled, users will be asked for a password even if one is stored.
+
When enabled, users will be asked for credentials even if they are stored.