centos7上源码搭建guacamole
guacamole是一款开源的且基于HTML5的适合WEB终端SSH工具,
1.安装guacamole所需要的依赖库
必需安装的库有
yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
可选择安装的库
yum install -y freerdp-devel pango-devel libssh2-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel
systemctl stop firewalld.service # 停止防火墙
systemctl disable firewalld.service #禁止开机启动防火墙
2.安装配置tomcat,架设服务(先必须有JDK1.8的环境)
/soft/tomcat-9.0.2
3. 安装guacamole
3.1 安装guacamole-server
使用wget命令或者本地下载后使用ftp工具上传到服务器
1. 解压 tar -xzf guacamole-server-0.9.14.tar.gz
2. 编译安装
cd guacamole-server-0.9.14
./configure --prefix=/usr/local/guacamole --with-init-dir=/etc/init.d
./configure --with-init-dir=/etc/init.d
make
make install
ldconfig
3.增加环境变量
vi /etc/profile
export GUACAMOLE_HOME=/etc/guacamole
source /etc/profile
3.2 安装guacamole-client
1. 下载客户端包guacamole-0.9.14.zip,将客户端包部署到Tomcat
unzip -d guacamole guacamole-0.9.14.zip
cpguacamole /soft/tomcat-9.0.2/webapps/guacamole.war
3.3.安装guacamole-client
创建配置文件夹
mkdir -p /etc/guacamole/
配置用户映射文件
vi /etc/guacamole/guacamole.properties
将文件内容改为下面的
basic-user-mapping: /etc/guacamole/user-mapping.xml
编写用户映射配置文件
vi /etc/guacamole/user-mapping.xml
在配置文件内,按下面的格式输入信息:
<user-mapping>
<authorize username="admin" password="123456">
<!-- First authorized connection -->
<connection name="ssh">
<protocol>ssh</protocol>
<param name="hostname">192.168.2.14</param>
<param name="port">22</param>
<param name="username">root</param>
<param name="password">cent</param>
</connection>
<!-- Second authorized connection -->
<connection name="vnc">
<protocol>vnc</protocol>
<param name="hostname">192.168.2.14</param>
<param name="port">5901</param>
<param name="username">root</param>
<param name="password">123456</param>
</connection>
<connection name="rdp">
<protocol>rdp</protocol>
<param name="hostname">192.168.2.14</param>
<param name="port">3389</param>
<param name="username">root</param>
<param name="password">cent</param>
</connection>
</authorize>
</user-mapping>
4.启动
service guacd start #启动guacamole
/soft/tomcat-9.0.2/bin/startup.sh #启动tomcat
#安装完成后先远程SLL登录,看是否安装成功,RDP协议需要配置。
5.被访问服务器(linux)安装xrdp:
vi /etc/yum.repos.d/xrdp.repo
[xrdp]
name=xrdp
baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/
enabled=1
gpgcheck=0
yum -y install xrdp tigervnc-server
#启动服务:
systemctl start xrdp.service
systemctl enable xrdp.service
#防火墙:
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
#配置SELinux
chcon --type=bin_t /usr/sbin/xrdp
chcon --type=bin_t /usr/sbin/xrdp-sesman