33.第27章 企業級安全堡壘機JumpServer


搭建jumpserver環境

1.創建mysql容器


[root@centos7-2 ~]# cat install_docker-v2.sh
#!/bin/bash
#
#******************************************************************************
#Author:        zhanghui
#QQ:            19661891
#Date:          2021-04-05
#FileName:      install_docker-v2.sh
#URL:           www.cnblogs.com/neteagles
#Description:   install_docker for centos 7/8 & ubuntu 18.04/20.04
#Copyright (C): 2021 All rights reserved
#******************************************************************************
COLOR="echo -e \\033[01;31m"
END='\033[0m'

os(){
    if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release;then
        rpm -q redhat-lsb-core &> /dev/null || { ${COLOR}"安裝lsb_release工具"${END};yum -y install  redhat-lsb-core &> /dev/null; }
    fi
    OS_ID=`lsb_release -is`
    OS_RELEASE_VERSION_VERSION=`lsb_release -rs |awk -F'.' '{print $1}'`
    OS_CODENAME=`lsb_release -cs`
}

ubuntu_install_docker(){
    dpkg -s docker-ce &>/dev/null && ${COLOR}"Docker已安裝,退出"${END} && exit
    local DOCKER_VERSION="5:19.03.15~3-0~ubuntu-${OS_CODENAME}"

    ${COLOR}"開始安裝DOCKER依賴包"${END}
    apt update &> /dev/null
    apt -y install apt-transport-https ca-certificates curl software-properties-common &> /dev/null
    curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add - &> /dev/null
    add-apt-repository  "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu  ${OS_CODENAME} stable" &> /dev/null 
    apt update &> /dev/null

    ${COLOR}"Docker有以下版本"${END}
    apt-cache madison docker-ce
    ${COLOR}"10秒后即將安裝:Docker-"${DOCKER_VERSION}"版本......"${END}
    ${COLOR}"如果想安裝其它Docker版本,請按Ctrl+c鍵退出,修改版本再執行"${END}
    sleep 10

    ${COLOR}"開始安裝DOCKER"${END}
    apt -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION} &> /dev/null
}

centos_install_docker(){
    rpm -q docker-ce &> /dev/null && ${COLOR}"Docker已安裝,退出"${END} && exit
    local DOCKER_VERSION="19.03.15-3.el${OS_RELEASE_VERSION}"
    cat > /etc/yum.repos.d/docker.repo <<-EOF
[docker]
name=docker
gpgcheck=0
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/${OS_RELEASE_VERSION}/x86_64/stable/
EOF
    yum clean all &> /dev/null

    ${COLOR}"Docker有以下版本"${END}
    yum list docker-ce.x86_64 --showduplicates  |grep docker-ce |sort -nr
    ${COLOR}"10秒后即將安裝:Docker-"${DOCKER_VERSION}"版本......"${END}
    ${COLOR}"如果想安裝其它Docker版本,請按Ctrl+c鍵退出,修改版本再執行"${END}
    sleep 10

    ${COLOR}"開始安裝DOCKER"${END}
    yum -y install docker-ce-$DOCKER_VERSION docker-ce-cli-$DOCKER_VERSION &> /dev/null || { ${COLOR}"Base,Extras的yum源失敗,請檢查yum配置"${END};exit; }
}

aliyun_jxjsq(){
    mkdir -p /etc/docker
    tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": ["https://hzw5xiv7.mirror.aliyuncs.com"]
}
EOF
    systemctl daemon-reload
    systemctl enable --now docker
    docker version &&  ${COLOR}"Docker 安裝成功"${END} || ${COLOR}"Docker 安裝失敗"${END}
}

set_alias(){
    echo 'alias rmi="docker imasges -qa|xargs docker rmi -f"' >> .bashrc
    echo 'alias rmc="docker ps -qa|xargs docker rm -f"' >> .bashrc
}

set_swap_limit(){
    ${COLOR}'設置Docker的"WARNING: No swap limit support"警告'${END}
    chmod u+w /etc/default/grub
    sed -i.bak 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=" net.ifnames=0 cgroup_enable=memory swapaccount=1"/' /etc/default/grub
    chmod u-w /etc/default/grub ;update-grub
    ${COLOR}"10秒后,機器會自動重啟"${END}
    sleep 10
    reboot
}

main(){
    os
    if [ ${OS_ID} == "CentOS" ] &> /dev/null;then
        centos_install_docker
        aliyun_jxjsq
        set_alias
        set_swap_limit
    else
        ubuntu_install_docker
        aliyun_jxjsq
        set_alias
        set_swap_limit
    fi
}

main

[root@centos7-2 ~]# mkdir -p /etc/mysql/mysql.conf.d/

[root@centos7-2 ~]# vim /etc/mysql/mysql.conf.d/mysqld.cnf
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.

#

# This program is free software; you can redistribute it and/or modify

# it under the terms of the GNU General Public License, version 2.0,

# as published by the Free Software Foundation.

#

# This program is also distributed with certain software (including

# but not limited to OpenSSL) that is licensed under separate terms,

# as designated in a particular file or component or in included license

# documentation.  The authors of MySQL hereby grant you an additional

# permission to link the program and your derivative works with the

# separately licensed software that they have included with MySQL.

#

# This program is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

# GNU General Public License, version 2.0, for more details.

#

# You should have received a copy of the GNU General Public License

# along with this program; if not, write to the Free Software

# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

 

#

# The MySQL  Server configuration file.

#

# For explanations see

# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

 

[mysqld]

pid-file    = /var/run/mysqld/mysqld.pid

socket      = /var/run/mysqld/mysqld.sock

datadir     = /var/lib/mysql

#log-error  = /var/log/mysql/error.log

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

 

character-set-server=utf8
:wq

[root@centos7-2 ~]# mkdir /etc/mysql/conf.d/

[root@centos7-2 ~]#  vim /etc/mysql/conf.d/mysql.cnf
[mysql]

default-character-set=utf8
:wq

[root@centos7-2 ~]#  mkdir /data/mysql

[root@centos7-2 ~]# docker run -it --rm mysql:5.6.46
2021-03-29 10:55:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.46-1debian9 started.

2021-03-29 10:55:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

2021-03-29 10:55:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.6.46-1debian9 started.

2021-03-29 10:55:19+00:00 [ERROR] [Entrypoint]: Database is uninitialized and password option is not specified

       You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD

[root@centos7-2 ~]# docker run -it -d -p 3306:3306 -v /etc/mysql/mysql.conf.d/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -v /etc/mysql/conf.d/mysql.cnf:/etc/mysql/conf.d/mysql.cnf -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD="neteagles.vip" mysql:5.6.48

Unable to find image 'mysql:5.6.48' locally

5.6.48: Pulling from library/mysql

7d2977b12acb: Pull complete

5fb8400e7f07: Pull complete

234877fbb165: Pull complete

6fe1021f12f3: Pull complete

7e36fe6b53f0: Pull complete

996ec709c11b: Pull complete

5198b7523387: Pull complete

cc9bdad4dcc0: Pull complete

380cd37ad979: Pull complete

d64465acf034: Pull complete

d4ee6606b3ab: Pull complete

Digest: sha256:2bf1a0a05a6ad437dcac6689e48a9c33774ac92c6213fce2c4196343210592f3

Status: Downloaded newer image for mysql:5.6.48

b9b188fe92c110f38f6f74c658333d70640f86184801a4b712173e7480176510

[root@centos7-2 ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES

b9b188fe92c1        mysql:5.6.48        "docker-entrypoint.s…"   20 seconds ago      Up 20 seconds       0.0.0.0:3306->3306/tcp   epic_lovelace

[root@centos7 ~]# yum -y install mysql

[root@centos7 ~]#  mysql -uroot -pneteagles.vip -h10.0.0.17
Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.48 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

MySQL [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

+--------------------+

3 rows in set (0.00 sec)

 

MySQL [(none)]>  show variables like "%character%";show variables like "%collation%";

+--------------------------+----------------------------+

| Variable_name            | Value                      |

+--------------------------+----------------------------+

| character_set_client     | utf8                       |

| character_set_connection | utf8                       |

| character_set_database   | utf8                       |

| character_set_filesystem | binary                     |

| character_set_results    | utf8                       |

| character_set_server     | utf8                       |

| character_set_system     | utf8                       |

| character_sets_dir       | /usr/share/mysql/charsets/ |

+--------------------------+----------------------------+

8 rows in set (0.00 sec)

 

+----------------------+-----------------+

| Variable_name        | Value           |

+----------------------+-----------------+

| collation_connection | utf8_general_ci |

| collation_database   | utf8_general_ci |

| collation_server     | utf8_general_ci |

+----------------------+-----------------+

3 rows in set (0.00 sec)

 

MySQL [(none)]> create database jumpserver default charset 'utf8';

Query OK, 1 row affected (0.00 sec)

 

MySQL [(none)]> grant all on jumpserver.* to 'jumpserver'@'%' identified by 'neteagles.vip';

Query OK, 0 rows affected (0.00 sec)

 

MySQL [(none)]> exit

Bye

[root@centos7 ~]#  mysql -ujumpserver -pneteagles.vip -h10.0.0.17

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.48 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

MySQL [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| jumpserver         |

+--------------------+

2 rows in set (0.00 sec)

 

MySQL [(none)]> exit

Bye

2.創建reids 容器

[root@centos7-2 ~]# docker pull redis:4.0.14
4.0.14: Pulling from library/redis

54fec2fa59d0: Pull complete

9c94e11103d9: Pull complete

04ab1bfc453f: Pull complete

7988789e1fb7: Pull complete

8ce1bab2086c: Pull complete

40e134f79af1: Pull complete

Digest: sha256:2e03fdd159f4a08d2165ca1c92adde438ae4e3e6b0f74322ce013a78ee81c88d

Status: Downloaded newer image for redis:4.0.14

docker.io/library/redis:4.0.14

[root@centos7-2 ~]# docker run -it -d -p 6379:6379 redis:4.0.14

c52ac031f480dc5fb7239509ec8f90c745bff3eda73d657bb8be698ad16a58eb

[root@centos7-2 ~]# ss -ntl
State       Recv-Q Send-Q              Local Address:Port                             Peer Address:Port             

LISTEN      0      128                             *:22                                          *:*                 

LISTEN      0      100                     127.0.0.1:25                                          *:*                 

LISTEN      0      128                          [::]:3306                                     [::]:*                 

LISTEN      0      128                          [::]:6379                                     [::]:*                 

LISTEN      0      128                          [::]:22                                       [::]:*                 

LISTEN      0      100                         [::1]:25                                       [::]:* 

[root@centos7-2 ~]# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES

c52ac031f480        redis:4.0.14        "docker-entrypoint.s…"   42 seconds ago      Up 41 seconds       0.0.0.0:6379->6379/tcp   strange_chandrasekhar

b9b188fe92c1        mysql:5.6.48        "docker-entrypoint.s…"   13 minutes ago      Up 13 minutes       0.0.0.0:3306->3306/tcp   epic_lovelace

[root@centos7 ~]# telnet 10.0.0.17 6379
Trying 10.0.0.17...

Connected to 10.0.0.17.

Escape character is '^]'.

info

$2698

# Server

redis_version:4.0.14

redis_git_sha1:00000000

redis_git_dirty:0

redis_build_id:165c932261a105d7

redis_mode:standalone

os:Linux 3.10.0-1160.el7.x86_64 x86_64

arch_bits:64

multiplexing_api:epoll

atomicvar_api:atomic-builtin

gcc_version:8.3.0

process_id:1

run_id:cad1c0405e2b3f7638c7bb05646aa0453dbeb348

tcp_port:6379

uptime_in_seconds:99

uptime_in_days:0

hz:10

lru_clock:6412084

executable:/data/redis-server

config_file:

 

# Clients

connected_clients:1

client_longest_output_list:0

client_biggest_input_buf:0

blocked_clients:0

 

# Memory

used_memory:849360

used_memory_human:829.45K

used_memory_rss:7970816

used_memory_rss_human:7.60M

used_memory_peak:849360

used_memory_peak_human:829.45K

used_memory_peak_perc:105.20%

used_memory_overhead:836126

used_memory_startup:786488

used_memory_dataset:13234

used_memory_dataset_perc:21.05%

total_system_memory:3953963008

total_system_memory_human:3.68G

used_memory_lua:37888

used_memory_lua_human:37.00K

maxmemory:0

maxmemory_human:0B

maxmemory_policy:noeviction

mem_fragmentation_ratio:9.38

mem_allocator:jemalloc-4.0.3

active_defrag_running:0

lazyfree_pending_objects:0

 

# Persistence

loading:0

rdb_changes_since_last_save:0

rdb_bgsave_in_progress:0

rdb_last_save_time:1617024721

rdb_last_bgsave_status:ok

rdb_last_bgsave_time_sec:-1

rdb_current_bgsave_time_sec:-1

rdb_last_cow_size:0

aof_enabled:0

aof_rewrite_in_progress:0

aof_rewrite_scheduled:0

aof_last_rewrite_time_sec:-1

aof_current_rewrite_time_sec:-1

aof_last_bgrewrite_status:ok

aof_last_write_status:ok

aof_last_cow_size:0

 

# Stats

total_connections_received:1

total_commands_processed:0

instantaneous_ops_per_sec:0

total_net_input_bytes:6

total_net_output_bytes:0

instantaneous_input_kbps:0.00

instantaneous_output_kbps:0.00

rejected_connections:0

sync_full:0

sync_partial_ok:0

sync_partial_err:0

expired_keys:0

expired_stale_perc:0.00

expired_time_cap_reached_count:0

evicted_keys:0

keyspace_hits:0

keyspace_misses:0

pubsub_channels:0

pubsub_patterns:0

latest_fork_usec:0

migrate_cached_sockets:0

slave_expires_tracked_keys:0

active_defrag_hits:0

active_defrag_misses:0

active_defrag_key_hits:0

active_defrag_key_misses:0

 

# Replication

role:master

connected_slaves:0

master_replid:7d0832814bef0d8741e5a725dba2f19adf340bd3

master_replid2:0000000000000000000000000000000000000000

master_repl_offset:0

second_repl_offset:-1

repl_backlog_active:0

repl_backlog_size:1048576

repl_backlog_first_byte_offset:0

repl_backlog_histlen:0

 

# CPU

used_cpu_sys:0.13

used_cpu_user:0.06

used_cpu_sys_children:0.00

used_cpu_user_children:0.00

 

# Cluster

cluster_enabled:0

 

# Keyspace

 

quit

+OK

Connection closed by foreign host.

3.安裝jumpserver

[root@centos7 ~]# cat install_docker-v2.sh
#!/bin/bash
#
#******************************************************************************
#Author:        zhanghui
#QQ:            19661891
#Date:          2021-04-05
#FileName:      install_docker-v2.sh
#URL:           www.cnblogs.com/neteagles
#Description:   install_docker for centos 7/8 & ubuntu 18.04/20.04
#Copyright (C): 2021 All rights reserved
#******************************************************************************
COLOR="echo -e \\033[01;31m"
END='\033[0m'

os(){
    if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release;then
        rpm -q redhat-lsb-core &> /dev/null || { ${COLOR}"安裝lsb_release工具"${END};yum -y install  redhat-lsb-core &> /dev/null; }
    fi
    OS_ID=`lsb_release -is`
    OS_RELEASE_VERSION_VERSION=`lsb_release -rs |awk -F'.' '{print $1}'`
    OS_CODENAME=`lsb_release -cs`
}

ubuntu_install_docker(){
    dpkg -s docker-ce &>/dev/null && ${COLOR}"Docker已安裝,退出"${END} && exit
    local DOCKER_VERSION="5:19.03.15~3-0~ubuntu-${OS_CODENAME}"

    ${COLOR}"開始安裝DOCKER依賴包"${END}
    apt update &> /dev/null
    apt -y install apt-transport-https ca-certificates curl software-properties-common &> /dev/null
    curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add - &> /dev/null
    add-apt-repository  "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu  ${OS_CODENAME} stable" &> /dev/null 
    apt update &> /dev/null

    ${COLOR}"Docker有以下版本"${END}
    apt-cache madison docker-ce
    ${COLOR}"10秒后即將安裝:Docker-"${DOCKER_VERSION}"版本......"${END}
    ${COLOR}"如果想安裝其它Docker版本,請按Ctrl+c鍵退出,修改版本再執行"${END}
    sleep 10

    ${COLOR}"開始安裝DOCKER"${END}
    apt -y install docker-ce=${DOCKER_VERSION} docker-ce-cli=${DOCKER_VERSION} &> /dev/null
}

centos_install_docker(){
    rpm -q docker-ce &> /dev/null && ${COLOR}"Docker已安裝,退出"${END} && exit
    local DOCKER_VERSION="19.03.15-3.el${OS_RELEASE_VERSION}"
    cat > /etc/yum.repos.d/docker.repo <<-EOF
[docker]
name=docker
gpgcheck=0
baseurl=https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/${OS_RELEASE_VERSION}/x86_64/stable/
EOF
    yum clean all &> /dev/null

    ${COLOR}"Docker有以下版本"${END}
    yum list docker-ce.x86_64 --showduplicates  |grep docker-ce |sort -nr
    ${COLOR}"10秒后即將安裝:Docker-"${DOCKER_VERSION}"版本......"${END}
    ${COLOR}"如果想安裝其它Docker版本,請按Ctrl+c鍵退出,修改版本再執行"${END}
    sleep 10

    ${COLOR}"開始安裝DOCKER"${END}
    yum -y install docker-ce-$DOCKER_VERSION docker-ce-cli-$DOCKER_VERSION &> /dev/null || { ${COLOR}"Base,Extras的yum源失敗,請檢查yum配置"${END};exit; }
}

aliyun_jxjsq(){
    mkdir -p /etc/docker
    tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": ["https://hzw5xiv7.mirror.aliyuncs.com"]
}
EOF
    systemctl daemon-reload
    systemctl enable --now docker
    docker version &&  ${COLOR}"Docker 安裝成功"${END} || ${COLOR}"Docker 安裝失敗"${END}
}

set_alias(){
    echo 'alias rmi="docker imasges -qa|xargs docker rmi -f"' >> .bashrc
    echo 'alias rmc="docker ps -qa|xargs docker rm -f"' >> .bashrc
}

set_swap_limit(){
    ${COLOR}'設置Docker的"WARNING: No swap limit support"警告'${END}
    chmod u+w /etc/default/grub
    sed -i.bak 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=" net.ifnames=0 cgroup_enable=memory swapaccount=1"/' /etc/default/grub
    chmod u-w /etc/default/grub ;update-grub
    ${COLOR}"10秒后,機器會自動重啟"${END}
    sleep 10
    reboot
}

main(){
    os
    if [ ${OS_ID} == "CentOS" ] &> /dev/null;then
        centos_install_docker
        aliyun_jxjsq
        set_alias
        set_swap_limit
    else
        ubuntu_install_docker
        aliyun_jxjsq
        set_alias
        set_swap_limit
    fi
}

main

[root@centos7 ~]# docker pull jumpserver/jms_all:1.5.9
1.5.9: Pulling from jumpserver/jms_all

524b0c1e57f8: Pull complete

a51e11f826ba: Pull complete

143549b5d79e: Pull complete

b663ada64c35: Pull complete

ae281f3d6562: Pull complete

6c5964dad37f: Pull complete

Digest: sha256:a4c4cdef12bb4d91ba78b3aa602ae4fe4f61c22f580f91f91e4583f8b623cfd5

Status: Downloaded newer image for jumpserver/jms_all:1.5.9

docker.io/jumpserver/jms_all:1.5.9

[root@centos7 ~]# if [ "$SECRET_KEY" = "" ]; then SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`; echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc; echo $SECRET_KEY; else echo $SECRET_KEY; fi
sIyZHZGlyp1CkSW60ttObTvCxTpXmUSJDzCol0WNrgnz1J88F6

[root@centos7 ~]# if [ "$BOOTSTRAP_TOKEN" = "" ]; then BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`; echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc; echo $BOOTSTRAP_TOKEN; else echo $BOOTSTRAP_TOKEN; fi
gVltdLPAXu1pcfCD

 
[root@centos7 ~]# docker run --name jms_all \

-v /opt/jumpserver:/opt/jumpserver/data/media \

-p 80:80 \

-p 2222:2222 \

-e SECRET_KEY=sIyZHZGlyp1CkSW60ttObTvCxTpXmUSJDzCol0WNrgnz1J88F6 \

-e BOOTSTRAP_TOKEN=gVltdLPAXu1pcfCD \

-e DB_HOST=10.0.0.17 \

-e DB_PORT=3306 \

-e DB_USER='jumpserver' \

-e DB_PASSWORD="neteagles.vip" \

-e DB_NAME=jumpserver \

-e REDIS_HOST=10.0.0.17 \

-e REDIS_PORT=6379 \

-e REDIS_PASSWORD= \

jumpserver/jms_all:1.5.9
30d6efae48eccfbea3ff6ac5288829c01570b21f29d96117b1113067d10ed598

root@centos7 ~]# docker ps
CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS                                        NAMES

30d6efae48ec        jumpserver/jms_all:1.5.9   "./entrypoint.sh"   18 seconds ago      Up 17 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:2222->2222/tcp   jms_all

[root@centos7 ~]# docker logs 30d6efae48ec
2021-03-29 22:31:22 Mon Mar 29 22:31:22 2021

2021-03-29 22:31:22 Jumpserver version 1.5.9, more see https://www.jumpserver.org

2021-03-29 22:31:22 Check database connection ...

users

 [X] 0001_initial

 [X] 0002_auto_20171225_1157_squashed_0019_auto_20190304_1459 (18 squashed migrations)

 [X] 0020_auto_20190612_1825

 [X] 0021_auto_20190625_1104

 [X] 0022_auto_20190625_1105

 [X] 0023_auto_20190724_1525

 [X] 0024_auto_20191118_1612

 [X] 0025_auto_20200206_1216

2021-03-29 22:31:27 Database connect success

2021-03-29 22:31:27 Check database structure change ...

2021-03-29 22:31:27 Migrate model change to database ...

Operations to perform:

  Apply all migrations: admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, ops, orgs, perms, sessions, settings, terminal, tickets, users

Running migrations:

  No migrations to apply.

2021-03-29 22:31:33 Collect static files

2021-03-29 22:31:37 Collect static files done

guacd[109]: INFO: Guacamole proxy daemon (guacd) version 1.0.0 started

Starting guacd: SUCCESS

Tomcat started.

Jumpserver ALL 1.5.9

官網 http://www.jumpserver.org

文檔 http://docs.jumpserver.org

有問題請參考 http://docs.jumpserver.org/zh/docs/faq.html

 

進入容器命令 docker exec -it jms_all /bin/bash


[root@centos7 ~]# mysql -ujumpserver -pneteagles.vip -h10.0.0.17

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MySQL connection id is 97

Server version: 5.6.48 MySQL Community Server (GPL)

 

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

MySQL [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| jumpserver         |

+--------------------+

2 rows in set (0.00 sec)

 

MySQL [(none)]> use jumpserver

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

MySQL [jumpserver]> show tables;

+----------------------------------------------+

| Tables_in_jumpserver                         |

+----------------------------------------------+

| applications_databaseapp                     |

| applications_remoteapp                       |

| assets_adminuser                             |

| assets_asset                                 |

| assets_asset_labels                          |

| assets_asset_nodes                           |

| assets_assetgroup                            |

| assets_authbook                              |

| assets_cluster                               |

| assets_commandfilter                         |

| assets_commandfilterrule                     |

| assets_domain                                |

| assets_favoriteasset                         |

| assets_gateway                               |

| assets_gathereduser                          |

| assets_label                                 |

| assets_node                                  |

| assets_platform                              |

| assets_systemuser                            |

| assets_systemuser_assets                     |

| assets_systemuser_cmd_filters                |

| assets_systemuser_groups                     |

| assets_systemuser_nodes                      |

| assets_systemuser_users                      |

| audits_ftplog                                |

| audits_operatelog                            |

| audits_passwordchangelog                     |

| audits_userloginlog                          |

| auth_group                                   |

| auth_group_permissions                       |

| auth_permission                              |

| authentication_accesskey                     |

| authentication_loginconfirmsetting           |

| authentication_loginconfirmsetting_reviewers |

| authentication_privatetoken                  |

| captcha_captchastore                         |

| django_admin_log                             |

| django_cas_ng_proxygrantingticket            |

| django_cas_ng_sessionticket                  |

| django_celery_beat_crontabschedule           |

| django_celery_beat_intervalschedule          |

| django_celery_beat_periodictask              |

| django_celery_beat_periodictasks             |

| django_celery_beat_solarschedule             |

| django_content_type                          |

| django_migrations                            |

| django_session                               |

| jms_oidc_rp_oidcuser                         |

| ops_adhoc                                    |

| ops_adhoc_execution                          |

| ops_adhoc_hosts                              |

| ops_celerytask                               |

| ops_commandexecution                         |

| ops_commandexecution_hosts                   |

| ops_task                                     |

| orgs_organization                            |

| orgs_organization_admins                     |

| orgs_organization_auditors                   |

| orgs_organization_users                      |

| perms_assetpermission                        |

| perms_assetpermission_assets                 |

| perms_assetpermission_nodes                  |

| perms_assetpermission_system_users           |

| perms_assetpermission_user_groups            |

| perms_assetpermission_users                  |

| perms_databaseapppermission                  |

| perms_databaseapppermission_database_apps    |

| perms_databaseapppermission_system_users     |

| perms_databaseapppermission_user_groups      |

| perms_databaseapppermission_users            |

| perms_remoteapppermission                    |

| perms_remoteapppermission_remote_apps        |

| perms_remoteapppermission_system_users       |

| perms_remoteapppermission_user_groups        |

| perms_remoteapppermission_users              |

| settings_setting                             |

| terminal                                     |

| terminal_command                             |

| terminal_commandstorage                      |

| terminal_replaystorage                       |

| terminal_session                             |

| terminal_status                              |

| terminal_task                                |

| tickets_comment                              |

| tickets_ticket                               |

| tickets_ticket_assignees                     |

| users_user                                   |

| users_user_groups                            |

| users_user_user_permissions                  |

| users_usergroup                              |

+----------------------------------------------+

90 rows in set (0.00 sec)

 

MySQL [jumpserver]> exit

Bye


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM