实现方法: 1.在Ubuntu中搭建guacamole (1) OS环境:最新版Ubuntu 16.04 (2) guacamole架构:guacamole包含两个部分,guacamole-client和guacamole-server。结构如图,其中guacd就是guacamole-server,servlet cantainer里的guacamole就是guacamole-client。 (3) Ubuntu中安装guacamole: ①$ apt-get install guacamole-tomcat 注:设置web容器(用的是tomcat7),使tomcat知道guacamole.war(该war包及其配置文件就是guacamole-client)以及其配置文件在哪里。 ②$ In -s /var/lib/guacamole/guacamole.war/var/lib/tomcat7/webapps ③$ In -s /etc/guacamole/guacamole.properties/user/share/tomcat7/.guacamole 注:设置guacamole-client配置文件,它的配置文件有两个,guacamole.properties和user-mapping.xml。前者设置guacd(guacamole-server)的地址和端口号,以及user-mapping.xml的位置。后者设置最终用户在web中登录guacamole时的用户名和密码,以及guacamole要访问的最终RDP Server/VNC Server的IP地址和密码。 其中,guacamole.properties默认已经设置好,无需修改,默认就好。需要修改user-mapping.xml的内容。user-mapping.xml内容如下:
<user-mapping> <authorize username="guacamoleusername" password="5f4dcc3b5aa765d61d8327deb882cf99" encoding="md5"> <connection name="SSH1"> <protocol>ssh</protocol> <param name="hostname">192.168.0.18</param> <param name="port">22</param> <param name="username">gacanepa</param> </connection> <connection name="RDP2"> <protocol>rdp</protocol> <param name="hostname">192.168.0.19</param> <param name="port">3389</param> <param name="password">123456</param> </connection> </authorize> </user-mapping>标签中,username和password是用户在浏览器里登录guacamole时,所用的用户名和密码。其中,password是字符串“password”的md5值(也可以将参数password设为明文,然后不要encoding=“md5”)。 标签中,设置要访问RDP Server/VNC Server的IP地址、访问协议以及访问密码。若最终的RDP Server/VNC Server不用密码,则在标签里不要设置。标签中可以有一个或多个(上面代码有两个),guacamole支持多连接。
注:这里的最简安装支持vnc。在里配置任何位置的一个VNC Server都是可以的。只要保证VNC Server可访问就可以了,这里是用的本机上vnc4server。使用vnc4server要提前做一个设置。打开桌面共享的设置(中文可以直接搜索桌面共享)。选中允许“其他人查看您的桌面”。另外下边的“必须对为对本机器的每次访问都进行确认”这一项,如果不选中,每次远程连接,都会在这台机器上弹出一个界面问你是否允许,每次你都需要来这里手动点击确定确认一下。所以根据你自己的安全需求,设置这个选项。
④$ vnc4server //启动vnc4server $ guacd //启动guacd(guacamole-server) $ sudo /etc/init.d/tomcat7 restart //重启tomcat(guacamole-client) ⑤在浏览器里访问了。例如127.0.0.1:8080/guacamole 这里的IP地址,换成你运行guacamole的地址。然后就会出现如下界面,在这里输入标签里设置的用户名”guacamoleusername”和密码”password”