ubuntu16.04架设开源堡垒机webterminal

ubuntu16.04安装webterminal

第一步,安装依赖

sudo apt update -y

sudo apt-get install -y python python-dev redis-server python-pip supervisor nginx git

sudo apt-get install python-software-properties build-essential libssh-dev software-properties-common curl gcc jq wget libjpeg-dev libjpeg-turbo8-dev -y

sudo apt install libcairo2-dev libjpeg62-dev libpng12-dev libossp-uuid-dev 

sudo apt install libavcodec-dev libavutil-dev libswscale-dev libfreerdp-dev libpango1.0-dev libssh2-1-dev libtelnet-dev libvncserver-dev libpulse-dev libssl-dev libvorbis-dev libwebp-dev 

第二步,安装ffmpeg

sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
sudo apt-get update -y
sudo apt-get install ffmpeg libffmpegthumbnailer-dev -y

第三步,安装guacamole-server

进入临时文件目录

cd /tmp

下载guacamole-server

wget http://sourceforge.net/projects/guacamole/files/current/source/guacamole-server-0.9.14.tar.gz

解压并安装

tar -xvpf guacamole-server-0.9.14.tar.gz
cd guacamole-server-0.9.14
./configure --with-init-dir=/etc/init.d
sudo make
sudo make install
sudo mkdir /usr/lib/x86_64-linux-gnu/freerdp
sudo cp /usr/local/lib/freerdp/* /usr/lib/x86_64-linux-gnu/freerdp/
sudo ldconfig
sudo service guacd start

设置guacd开机自启动

sudo update-rc.d guacd defaults

第四步,安装webterminal堡垒机

cd /opt
sudo git clone https://github.com/jimmy201602/webterminal.git
cd webterminal
sudo mkdir media
sudo pip install -r requirements.txt

如果需要更换数据库为MySQL还要安装MySQL-python,并修改settings.py文件

sudo apt-get install libmysqlclient-dev 
sudo pip install MySQL-python

创建数据库和管理员

sudo python manage.py makemigrations
sudo python manage.py migrate
sudo python manage.py createsuperuser
按提示输入帐号、邮箱、密码

第五步,修改配置文件

sudo cp /opt/webterminal/nginx.conf /etc/nginx/nginx.conf
sudo cp /opt/webterminal/supervisord.conf /etc/supervisor/supervisord.conf
sudo service nginx restart

运行堡垒机

sudo python /opt/webterminal/manage.py runserver

访问http://hostip

/# sudo guacd -b localhost -L debug -f 调试模式

你可能感兴趣的:(ubuntu16.04架设开源堡垒机webterminal)