我对 Guacamole 还很陌生,但我确实了解它的工作原理。我相当确定我已经正确安装和配置了所有内容,但当我尝试登录时,即使使用默认的 user-mapping.xml,我也会收到无效登录消息。
我已将 $GUACAMOLE_HOME 变量设置为以下内容:
/etc/guacamole/
guacamole.properties如下:
# Hostname and port of guacamole proxy
guacd-hostname: localhost
guacd-port: 4822
# Auth provider class (authenticates user/pass combination, needed if using the provided login screen)
auth-provider: net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider
basic-user-mapping: /etc/guacamole/user-mapping.xml
我的user-mapping.xml如下:
<user-mapping>
<!-- Example user configurations are given below. For more information,
see the user-mapping.xml section of the Guacamole configuration
documentation: http://guac-dev.org/Configuring%20Guacamole -->
<!-- Per-user authentication and config information -->
<!--
<authorize username="USER1" password="PASSWORD">
<protocol>rdp</protocol>
<param name="hostname">192.168.1.90</param>
<param name="port">3389</param>
</authorize>
-->
<!-- Another user, but using md5 to hash the password
(example below uses the md5 hash of "PASSWORD") -->
<!--
<authorize
username="USERNAME2"
password="319f4d26e3c536b5dd871bb2c52e3178"
encoding="md5">
<protocol>vnc</protocol>
<param name="hostname">localhost</param>
<param name="port">5901</param>
<param name="password">VNCPASS</param>
</authorize>
-->
</user-mapping>
在 ~/tomcat8/.guacamole/ 上执行 ls -la 得到以下结果:
guacamole.properties -> /etc/guacamole/guacamole.properties
日志文件显示 user-mapping.xml 文件正在被 tomcat 读取:
Nov 02, 2019 1:49:17 PM net.sourceforge.guacamole.net.basic.BasicFileAuthenticationProvider info
INFO: Reading user mapping file: /etc/guacamole/user-mapping.xml
Nov 02, 2019 1:49:17 PM org.glyptodon.guacamole.net.basic.AuthenticatingHttpServlet warn
WARNING: Authentication attempt from 192.168.1.115 for user "USER1" failed.
Nov 02, 2019 1:49:17 PM org.glyptodon.guacamole.net.basic.AuthenticatingHttpServlet warn
WARNING: Permission denied: Not authenticated
正如我所说,即使我使用带有用户名和密码的默认 user-mapping.xml,仍然会出现相同的错误。
环境如下:
Ubuntu 16.04
Tomcat8
openjdk 版本“1.8.0_222”
OpenJDK 运行环境(构建 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10)
OpenJDK 64 位服务器 VM(版本 25.222-b10,混合模式)
Guacamole 代理守护进程 (guacd) 版本 0.8.3
答案1
文件中的所有内容user-mapping.xml
均已被注释掉。它实际上是空的。
删除相关标签前后的<!--
和标记。-->
<authorize>
将来使用支持语法高亮的编辑器 - 您会看到它们被突出显示为注释,而不是标签。