jumpserver1.5.9安装
##jumpserver 1.5.9安装
#!/bin/bash
###jumpserver 1.5.9
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
hostnamectl set-hostname node$(hostname -I |cut -d '.' -f4)
#@准备Python3和python虚拟环境
#安装依赖包
yum -y install wget gcc git epel-release
#安装Python3.6
yum -y install python36 python36-devel
#安装redis
yum -y install redis
systemctl enable redis
systemctl start redis
#安装mariadb
yum -y install mariadb mariadb-devel mariadb-server mariadb-shared
systemctl enable mariadb
systemctl start mariadb
#创建数据看看jumpserver并授权
mysql -e "create database if not exists jumpserver default charset 'utf8';
grant all on jumpserver.* TO 'jumpserver'@'localhost' IDENTIFIED BY 'jumpserver';
flush privileges;"
mysql -ujumpserver -pjumpserver -e 'show databases;'
#建⽴Python虚拟环境
python3.6 -m venv /opt/py3
source /opt/py3/bin/activate
wget 134.175.107.119/download/jumpserver/1.5.9/
tar zxvf -C /opt/
####安装编译环境依赖
cd /opt/jumpserver/requirements
#安装依赖rpm包
yum install -y $(cat )
#安装Python库依赖
pip install wheel && \
pip install --upgrade pip setuptools && \
pip install -
#确保已经载⼊ py3 虚拟环境, 中间如果遇到报错⼀般是依赖包没装全, 可以通过搜索引擎解决
#国内可以使⽤镜像加速
#
#pip install wheel -i mirrors.aliyun/pypi/simple/
#pip install --upgrade pip setuptools -i mirrors.aliyun/pypi/simple/
#pip install - -i mirrors.aliyun/pypi/simple/
##修改配置⽂件
cd /opt/jumpserver
\cp l
SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`
echo"SECRET_KEY=$SECRET_KEY" >> ~/.bashrc
BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`
echo"BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc
sed -i "s/SECRET_KEY:/SECRET_KEY: $SECRET_KEY/g" /opt/l
sed -i "s/BOOTSTRAP_TOKEN:/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/l
sed -i "s/# DEBUG: true/DEBUG: false/g" /opt/l
sed -i "s/# LOG_LEVEL: DEBUG/LOG_LEVEL: ERROR/g" /opt/l
sed -i "s/# SESSION_EXPIRE_AT_BROWSER_CLOSE: false/SESSION_EXPIRE_AT_BROWSER_CLOSE: true/g" /opt/l
####数据库密码jumpserver
sed -i 's/DB_PASSWORD:.*/DB_PASSWORD: jumpserver/g' /opt/l
echo -e "\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m"
echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
##echo -e "\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m"
## 你的SECRET_KEY是 jZIfxus6Admhip2vsuOzAEqh3byK5jUx6KOc0hNYaNZSvFjiJW
##(py3) [root@node70 jumpserver]# echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
## 你的BOOTSTRAP_TOKEN是 wv5gsAwJdTJOSCab
###启动 jumpserver 要在后台运⾏加 ./jms start -d
source /opt/py3/bin/activate &&  cd /opt/jumpserver && ./jms start
##正常部署 koko 组件
cd /opt
#wget 134.175.107.119/download/koko/1.5.9/
wget github/jumpserver/koko/releases/download/1.5.9/
tar -zxvf -C /opt/
chown -R root:root /opt/kokodir
cd /opt/kokodir
\cp l
sed -i "s/BOOTSTRAP_TOKEN:.*/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/l
sed -i "s/# LOG_LEVEL:.*/LOG_LEVEL: ERROR/" /opt/l
sed -i "s/# SHARE_ROOM_TYPE:.*/SHARE_ROOM_TYPE: redis/" /opt/l
### Redis配置
sed -i "s/# REDIS_HOST:.*/REDIS_HOST: 127.0.0.1/" /opt/l
sed -i "s/# REDIS_PORT:.*/REDIS_PORT: 6379/" /opt/l
#sed -i "s/# REDIS_PASSWORD:.*/REDIS_PASSWORD: ZhYnLrodpmPncovxJTnRyiBs/" /opt/l
sed -i "s/# REDIS_DB_ROOM:.*/REDIS_DB_ROOM: 6/" /opt/l
grep -Ev '^$|^#' /opt/l
###启动 koko 要在后台运⾏加 ./koko -d
source /opt/py3/bin/activate &&  cd /opt/kokodir  && ./koko
##docker 部署 koko 组件如果前⾯已经正常部署了 koko, 可以跳过此步骤
#docker run --name jms_koko -d -p 2222:2222  -p 127.0.0.1:5000:5000  -e CORE_HOST=192.168.244.144:8080  -e BOOTSTRAP_TOKEN=zxffNymGjP79j6BN -e LOG_LEVEL=ERROR  --restart=always jumpserver/jm
###正常安装并启动 guacamole 组件
#根据 guacamole官⽅⽂档⽂档安装对应的依赖包
###Fedora/CentOS/RHEL:
yum -y localinstall --nogpgcheck mirrors.aliyun/rpmfusion/free/arch.rpm mirrors.aliyun/rpmfusion/nonfree/arch.rpm && \
yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel && \
yum install -y ffmpeg-devel freerdp1.2-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel && \
ln -s /usr/local/lib/freerdp /usr/lib64/freerdp
>>####automake-1.15
wget /gnu/automake/automake-1.
tar -zxvf automake-1. -C /opt/
cd /opt/automake-1.15
./bootstrap.sh
./configure && make && make install
automake --version
>>>>>####
yum install -y libtool
##正常安装并启动 guacamole 组件
cd /opt
git clone --depth=1 github/jumpserver/docker-guacamole.git
cd /opt/docker-guacamole && \
tar -xf guacamole-server-1.0. && \
tar -xf -C /bin/ && \
chmod +x /bin/ssh-forward
cd /opt/docker-guacamole/guacamole-server-1.0.0
autoreconf -fi && ./configure --with-init-dir=/etc/init.d && make && make install
>>>##需要先在当前环境配置好 java
#Centos:
yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
mkdir -p /config/guacamole /config/guacamole/extensions /config/guacamole/record /config/guacamole/drive && \
chown daemon:daemon /config/guacamole/record /config/guacamole/drive && \
cd /config
>>>>>###
wget mirrors.tuna.tsinghua.edu/apache/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.
tar -xf apache-tomcat-9.0. && \linux安装redis报错
mv apache-tomcat-9.0.35 tomcat9 && \
rm -rf /config/tomcat9/webapps/* && \
sed -i 's/Connector port="8080"/Connector port="8081"/g' /config/tomcat9/l && \
echo "java.util.ding = UTF-8" >> /config/tomcat9/conf/logging.properties && \
ln -sf /opt/docker-guacamole/guacamole-1.0.0.war /config/tomcat9/webapps/ROOT.war && \
ln -sf /opt/docker-guacamole/guacamole-auth-jumpserver-1.0.0.jar /config/guacamole/extensions/guacamole-auth-jumpserver-1.0.0.jar && \
ln -sf /opt/docker-guacamole/root/app/guacamole/guacamole.properties /config/guacamole/guacamole.properties
##设置 guacamole 环境
export JUMPSERVER_SERVER=127.0.0.1:8080
echo "export JUMPSERVER_SERVER=127.0.0.1:8080" >> ~/.bashrc
export BOOTSTRAP_TOKEN=zxffNymGjP79j6BN
echo "export BOOTSTRAP_TOKEN=zxffNymGjP79j6BN" >> ~/.bashrc
export JUMPSERVER_KEY_DIR=/config/guacamole/keys
echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc
export GUACAMOLE_HOME=/config/guacamole
echo "export GUACAMOLE_HOME=/config/guacamole" >> ~/.bashrc
export GUACAMOLE_LOG_LEVEL=ERROR
echo "export GUACAMOLE_LOG_LEVEL=ERROR" >> ~/.bashrc
export JUMPSERVER_ENABLE_DRIVE=true
echo "export JUMPSERVER_ENABLE_DRIVE=true" >> ~/.bashrc
####环境变量说明
###JUMPSERVER_SERVER 指 core 访问地址
###BOOTSTRAP_TOKEN 为 l ⾥⾯的 BOOTSTRAP_TOKEN 值
###JUMPSERVER_KEY_DIR 认证成功后 key 存放⽬录
###GUACAMOLE_HOME 为 guacamole.properties 配置⽂件所在⽬录
###GUACAMOLE_LOG_LEVEL 为⽣成⽇志的等级
###JUMPSERVER_ENABLE_DRIVE 为 rdp 协议挂载共享盘
###启动 guacamole
/etc/init.d/guacd start
sh /config/tomcat9/bin/startup.sh
>docker 部署 guacamole 组件
###如果前⾯已经正常部署了 guacamole, 可以跳过此步骤
##docker run --name jms_guacamole -d \
##  -p 127.0.0.1:8081:8080 \
##  -e JUMPSERVER_SERVER=<Jumpserver_url> \
##  -e BOOTSTRAP_TOKEN=<Jumpserver_BOOTSTRAP_TOKEN> \
##  -e GUACAMOLE_LOG_LEVEL=ERROR \
##  jumpserver/jms_guacamole:<Tag>
##<Jumpserver_url> 为 jumpserver 的 url 地址, <Jumpserver_BOOTSTRAP_TOKEN> 需要从 l ⾥⾯获取, 保证⼀致, <Tag> 是版本
##例:
#docker run --name jms_guacamole -d  -p 127.0.0.1:8081:8080 -e JUMPSERVER_SERVER=192.168.244.144:8080  -e BOOTSTRAP_TOKEN=abcdefg1234  -e GUACAMOLE_LOG_LEVEL=ERROR  jumpserver/jms_g ####下载 luna 组件
cd /opt
wget 134.175.107.119/download/luna/1.5.9/
##wget github/jumpserver/luna/releases/download/1.5.9/
tar -xf
chown -R nginx:nginx luna
>nginx
yum install -y yum-utils
echo '[nginx-stable]
name=nginx stable repo
baseurl=/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1
enabled=0
gpgkey=/keys/nginx_signing.key
module_hotfixes=true' >/pos.po
yum install -y nginx
\cp /etc/nginx/conf.f{,.bak}
echo >/etc/nginx/conf.f
echo '
server {
listen 80;
client_max_body_size 100m;  # 录像及⽂件上传⼤⼩限制
location /luna/ {
try_files $uri / /index.html;
alias /opt/luna/;  # luna 路径, 如果修改安装⽬录, 此处需要修改
}
location /media/ {
add_header Content-Encoding gzip;
root /opt/jumpserver/data/;  # 录像位置, 如果修改安装⽬录, 此处需要修改    }
location /static/ {
root /opt/jumpserver/data/;  # 静态资源, 如果修改安装⽬录, 此处需要修改    }
location /koko/ {
proxy_pass      localhost:5000;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
location /guacamole/ {
proxy_pass      localhost:8081/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
location /ws/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass localhost:8070;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_pass localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
' >/etc/nginx/conf.f
nginx -t
systemctl start nginx.service

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

发表评论