为了设置reverse-connect 功能,您需要做一些事情:
因此,在典型的授权场景中,您在 user-mapping.xml 中有类似的内容,其中包含反向连接的必要信息:
<authorize username="user" password="password">
<connection name="reverse">
<protocol>vnc</protocol>
<param name="hostname">localhost</param>
<param name="port">9999</param>
<param name="reverse-connect">true</param>
<param name="listen-timeout">30000</param>
<param name="autoretry">true</param>
</connection>
</authorize>
由于您是通过 MySQL 执行此操作,因此原理相同:
连接和参数
每个连接在 guacamole_connection 表中都有一个条目,带有一个
与参数的一对多关系,存储为名称/值对
guacamole_connection_parameter 表。
guacamole_connection 表只是一对独特的和
用于连接的协议的描述性名称。与添加用户相比,添加连接和相应参数相对容易,因为无需生成盐,也无需哈希密码:
-- Create connection
INSERT INTO guacamole_connection (connection_name, protocol) VALUES ('reverse', 'vnc');
SET @id = LAST_INSERT_ID();
-- Add parameters
INSERT INTO guacamole_connection_parameter VALUES (@id, 'hostname', 'localhost');
INSERT INTO guacamole_connection_parameter VALUES (@id, 'port', '9999');
INSERT INTO guacamole_connection_parameter VALUES (@id, 'reverse-connect', 'true');
...
正在连接:
在 Guacamole 中打开连接,然后使用 VNC 客户端连接到 Guacamole Server 上的端口(例如,:9999,如上例所示)。如果您不先在 Guacamole 中打开连接,guacd 将不会在给定端口上侦听。
如果设置了user-mapping.xml或包含reverse-connect参数的MySQL授权后无法建立连接,建议安装最新版本的libvncserver,其中有@987654323 @已定义。在执行 Guacamole 的 ./configure 时,您应该注意如果未定义警告:
--------------------------------------------
No listening support found in libvncclient.
Support for listen-mode connections will not be built.
--------------------------------------------