Jumpserver最新版本支持windows组件,废话不多介绍了,下面直接介绍下部署过程:
0)系统环境
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
CentOS 7.3
IP: 192.168.10.210
[root@jumpserver-server ~]
# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
关闭防火墙和selinux
[root@jumpserver-server ~]
# systemctl stop firewalld.service
[root@jumpserver-server ~]
# systemctl disable firewalld.service
[root@jumpserver-server ~]
# setenforce 0
[root@jumpserver-server ~]
# getenforce
[root@jumpserver-server ~]
# cat /etc/sysconfig/selinux
........
SELINUX=disabled
修改字符集,否则可能报 input
/output
error的问题,因为日志里打印了中文
[root@jumpserver-server ~]
# localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
[root@jumpserver-server ~]
# export LC_ALL=zh_CN.UTF-8
[root@jumpserver-server ~]
# echo 'LANG=zh_CN.UTF-8' > /etc/sysconfig/i18n
|
1)准备Python3和Python虚拟环境
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1.1)安装依赖包
[root@jumpserver-server ~]
# yum -y install wget libselinux-python sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
1.2)编译安装(这里必须执行编译安装,否则在安装 Python 库依赖时会有麻烦)
[root@jumpserver-server ~]
# cd /usr/local/src/
[root@jumpserver-server src]
# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
[root@jumpserver-server src]
# tar xvf Python-3.6.1.tar.xz
[root@jumpserver-server src]
# cd Python-3.6.1
[root@jumpserver-server Python-3.6.1]
# ./configure && make && make install
1.3)建立Python虚拟环境
因为CentOS 6
/7
自带的是Python2,而Yum等工具依赖原来的Python,为了不扰乱原来的环境我们来使用Python虚拟环境
[root@jumpserver-server ~]
# cd /opt/
[root@jumpserver-server opt]
# python3 -m venv py3
[root@jumpserver-server opt]
# source /opt/py3/bin/activate
(py3) [root@jumpserver-server opt]
#
看到上面的提示符代表成功,以后运行Jumpserver都要先运行以上
source
命令,以下所有命令均在该虚拟环境中运行!
|
2)安装Jumpserver 1.0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
2.1)下载或clone项目
除了在github上下载外,还可以到百度云盘上下载:https:
//pan
.baidu.com
/s/1BVYRF7M-akKjUOoYZPBi7Q
(提取密码:v5rs)
(py3) [root@jumpserver-server ~]
# cd /opt/
(py3) [root@jumpserver-server opt]
# git clone https://github.com/jumpserver/jumpserver.git
2.2)安装依赖rpm包
(py3) [root@jumpserver-server opt]
# cd /opt/
(py3) [root@jumpserver-server opt]
# cd jumpserver/requirements
(py3) [root@jumpserver-server requirements]
# yum -y install epel-release
(py3) [root@jumpserver-server requirements]
# yum -y install $(cat rpm_requirements.txt) //如果没有任何报错请继续
2.3)安装python库依赖
(py3) [root@jumpserver-server requirements]
# pip install -r requirements.txt //如果没有任何报错请继续
2.4)安装Redis, Jumpserver 使用 Redis 做 cache 和 celery broke
(py3) [root@jumpserver-server requirements]
# yum -y install redis
(py3) [root@jumpserver-server requirements]
# systemctl start redis
(py3) [root@jumpserver-server requirements]
# lsof -i:6379
COMMAND PID USER FD TYPE DEVICE SIZE
/OFF
NODE NAME
redis-ser 11281 redis 4u IPv4 90233 0t0 TCP localhost:6379 (LISTEN)
2.5)安装MySQL
(py3) [root@jumpserver-server requirements]
# yum -y install mariadb mariadb-devel mariadb-server
(py3) [root@jumpserver-server requirements]
# systemctl enable mariadb
(py3) [root@jumpserver-server requirements]
# systemctl start mariadb
(py3) [root@jumpserver-server requirements]
# systemctl status mariadb
(py3) [root@jumpserver-server requirements]
# lsof -i:3306
设置mysql密码,比如密码设置为123456
(py3) [root@jumpserver-server requirements]
# mysql_secure_installation
......
Set root password? [Y
/n
] y
New password:
//
比如密码是123456
Re-enter new password:
......
//
其他项全部回车默认
创建数据库Jumpserver并授权
(py3) [root@jumpserver-server requirements]
# mysql -p123456
MariaDB [(none)]> create database jumpserver default charset
'utf8'
;
MariaDB [(none)]> grant all on jumpserver.* to
'jumpserver'
@
'127.0.0.1'
identified by
'jumpserver@123'
;
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| jumpserver |
| mysql |
| performance_schema |
|
test
|
+--------------------+
2.6)安装 python3 mysql驱动: mysqlclient
由于MySQLdb库不支持 python3.5+,所以选择了mysqlclient作为驱动,pymysql使用python写的,速度较慢
(py3) [root@jumpserver-server requirements]
# pip install mysqlclient
2.7)修改jumpserver配置文件
计划修改 DevelopmentConfig中的配置,因为默认jumpserver是使用该配置,它继承自Config。
(py3) [root@jumpserver-server opt]
# cd /opt/jumpserver
(py3) [root@jumpserver-server jumpserver]
# cp config_example.py config.py
(py3) [root@jumpserver-server jumpserver]
# vim config.py
.....
class ProductionConfig(Config):
pass
class DevelopmentConfig(Config):
//
从这一行开始添加
DEBUG = True
DISPLAY_PER_PAGE = 20
DB_ENGINE =
'mysql'
DB_HOST =
'127.0.0.1'
DB_PORT = 3306
DB_USER =
'jumpserver'
DB_PASSWORD =
'jumpserver@123'
DB_NAME =
'jumpserver'
EMAIL_HOST =
'smtp.kevin.com'
EMAIL_PORT = 465
EMAIL_HOST_PASSWORD =
'monit@123'
EMAIL_USE_SSL = True
EMAIL_USE_TLS = False
EMAIL_SUBJECT_PREFIX =
'[Jumpserver] '
SITE_URL =
'http://192.168.10.210:8080'
//
一直添加到这一行
# Default using Config settings, you can write if/else for different env
config = DevelopmentConfig()
2.8)生成数据库表结构和初始化数据
(py3) [root@jumpserver-server jumpserver]
# cd /opt/jumpserver/utils
(py3) [root@jumpserver-server utils]
# ls
clean_migrations.sh export_fake_data.sh load_fake_data.sh make_migrations.sh redis.conf
(py3) [root@jumpserver-server utils]
# bash make_migrations.sh
.....
""
"
jumpserver.config
~~~~~~~~~~~~~~~~~
Jumpserver project setting
file
........
Applying django_celery_beat.0002_auto_20161118_0346... OK
Applying django_celery_beat.0003_auto_20161209_0049... OK
Applying django_celery_beat.0004_auto_20170221_0000... OK
Applying terminal.0002_auto_20180318_2330... OK
出现如上信息,即表示操作成功!
2.9)运行Jumpserver
(py3) [root@jumpserver-server utils]
# cd /opt/jumpserver
(py3) [root@jumpserver-server jumpserver]
# python run_server.py & //按键ctrl+c结束
(py3) [root@jumpserver-server jumpserver]
# lsof -i:8080
COMMAND PID USER FD TYPE DEVICE SIZE
/OFF
NODE NAME
gunicorn 17338 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)
gunicorn 28888 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)
gunicorn 28890 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)
gunicorn 28894 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)
gunicorn 28896 root 5u IPv4 204937 0t0 TCP *:webcache (LISTEN)
运行不报错,请浏览器访问 http:
//192
.168.10.210:8080/ 账号: admin 密码: admin
|
3)测试使用Jumpserver 1.0.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
a)创建用户:测试是否正常发送邮件,通过邮件中的链接进行密码设置;测试是否正常修改密码,登录。
b)创建管理用户:创建一个管理用户, 创建资产时需要关联
c)创建资产:创建一个 资产,关联刚创建的管理用户
d)创建系统用户:系统用户是用来登录资产的,授权时需要
e)创建授权规则:关联用户,资产,系统用户 形成授权规则,授权的系统用户会自动推送到资产上
注意事项:
3.1)新版本的jumpserver界面里创建的用户不会自动在jumpserver部署机上创建,即
/etc/passwd
文件里不会有这些用户信息。
(jumpserver3.0之前都是会在jumpserver部署机上创建用户的)
3.2)用户的秘钥可以在jumpserver部署机上生产,根据每个用户创建时填写的邮件(用户邮件不能重复)进行生成。如下创建wangshibo用户的秘钥:
[root@jumpserver-server ~]
# ssh-keygen -t rsa -C "[email protected]"
Generating public
/private
rsa key pair.
Enter
file
in
which
to save the key (
/root/
.
ssh
/id_rsa
):
/root/
.
ssh
/wangshibo_id_rsa
//
在这一步要指定邮件指定秘钥文件名称
Enter passphrase (empty
for
no passphrase):
Enter same passphrase again:
Your identification has been saved
in
/root/
.
ssh
/wangshibo_id_rsa
.
Your public key has been saved
in
/root/
.
ssh
/wangshibo_id_rsa
.pub.
The key fingerprint is:
SHA256:VAPokLf1L5Q20TOloendiZWDx4BFHfo4y2GMxZMPDVA [email protected]
The key's randomart image is:
+---[RSA 2048]----+
| . ...+BEoo. |
| o o ..o=+@.. |
| + o..ooXoB |
| o. .*= @ o |
| SoooO = |
| .o.+ |
| .o |
| |
| |
+----[SHA256]-----+
[root@[root@jumpserver-server ~]
# ~]# cd /root/.ssh/
[root@[root@jumpserver-server ~]
# .ssh]# ll
total 20
-rw-r--r--. 1 root root 1371 Mar 31 22:12 known_hosts
-rw-------. 1 root root 1675 Mar 31 14:42 wangshibo_id_rsa
-rw-r--r--. 1 root root 409 Mar 31 14:42 wangshibo_id_rsa.pub
然后使用wanghsibo用户登录jumpserver界面后,用上面的wangshibo_id_rsa.pub文件中的公钥内容进行提交!
3.3)被添加的主机要关闭iptables和selinux。即:
# /etc/init.d/iptables stop
# yum install libselinux-python -y
# setenforce 0
# getenforce
否则在执行推送作业时会报错:
Set ops authorized key => Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!
3.4)管理用户要是真实存在被添加主机系统上的用户,最好用root账号(真实的root密码)或是其他能有
sudo
权限的账号。
3.5)若是系统用户不能自动推送,可以手动点击
"推送"
3.6)主机资产添加后,要登录查看它们是否被正常推送了系统用户以及
sudo
权限是否正常设置了。
3.7)检查
"作业中心"
-
"任务列表"
里的任务是否都被成功执行了,如果有报错,可以根据具体报错信息进行修复。
|
4)安装 SSH Server: Coco
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
新开一个终端,别忘了
"source /opt/py3/bin/activate"
,
4.1)载coco项目。
也可以百度云盘下载:https:
//pan
.baidu.com
/s/1rEFg1Wlw9ZtK6YPsyaqDiA
提取密码:x8ga
(py3) [root@jumpserver-server ~]
# cd /opt
(py3) [root@jumpserver-server opt]
# git clone https://github.com/jumpserver/coco.git
4.2)安装依赖
(py3) [root@jumpserver-server opt]
# cd /opt/coco/requirements
(py3) [root@jumpserver-server requirements]
# yum -y install $(cat rpm_requirements.txt)
(py3) [root@jumpserver-server requirements]
# pip install -r requirements.txt
4.3)查看配置文件并运行
(py3) [root@jumpserver-server requirements]
# cd /opt/coco
(py3) [root@jumpserver-server coco]
# cp conf_example.py conf.py
[root@centos6-test10 coco]
# python run_server.py &
这时候仔细观察,会有如下报错信息:
ERROR:root:Load access key failed
Using access key 311d0e77-5ec9-4c46-a131-7409e1daf271:***
WARNING:
/opt/coco/coco/service
.py:App auth failed, Access key error or need admin active it
这时需要去jumpserver界面的管理后台-会话管理-终端管理-进行coco的注册。
注册完成后,上面的启动信息中的报错就不会出现了
(py3) [root@jumpserver-server coco]
# lsof -i:2222
COMMAND PID USER FD TYPE DEVICE SIZE
/OFF
NODE NAME
python3 17738 root 7u IPv4 207992 0t0 TCP *:EtherNet
/IP-1
(LISTEN)
|
只要2222端口是启动起来的,则下面注册的Coco项目就会是"在线"状态中的!
4.4)测试连接
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
要保证2222端口是启动着的。然后进行堡垒机的连接测试,可以使用默认的admin用户或上面自己创建的wangshibo用户。
注意这些用户创建后不会再jumpserver部署机里自动创建成系统用户(但是3.0之前的jumpserver会在部署机上自动创建)
(py3) [root@jump-v4 coco]
# ssh -p2222 [email protected] //admin的密码默认是admin
......
[email protected]'s password:
Administrator, 欢迎使用Jumpserver开源跳板机系统
1) 输入 ID 直接登录 或 输入部分 IP,主机名,备注 进行搜索登录(如果唯一).
2) 输入 / + IP, 主机名 or 备注 搜索. 如:
/ip
3) 输入 P
/p
显示您有权限的主机.
4) 输入 G
/g
显示您有权限的主机组.
5) 输入 G
/g
+ 组ID 显示该组下主机. 如: g1
6) 输入 H
/h
帮助.
0) 输入 Q
/q
退出.
-------------------------------------------------
如果是用Xshell登录的话,语法如下
密码: admin
如果能登陆代表部署成功
------------------------------------------------
|
5)安装 Web Terminal: Luna
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
新开一个终端,连接测试机,别忘了
"source /opt/py3/bin/activate"
Luna 已改为纯前端,需要 Nginx 来运行访问。
可以访问https:
//github
.com
/jumpserver/luna/releases
下载对应版本的 release 包,直接解压,不需要编译
也可以百度云盘下载:https:
//pan
.baidu.com
/s/18AJUD25f6XLxk6RrGOBF5w
提取密码:nfgg
5.1)下载luna项目
(py3) [root@jumpserver-server coco]
# cd /opt/
(py3) [root@jumpserver-server opt]
# wget https://github.com/jumpserver/luna/releases/download/v1.0.0/luna.tar.gz
(py3) [root@jumpserver-server opt]
# tar xvf luna.tar.gz
(py3) [root@jumpserver-server opt]
# ls /opt/luna
5.2)安装 Windows 支持组件。这一步是安装Windows支持组件(如果不需要管理 windows 资产,可以直接跳过这一步)!
因为手动安装 guacamole 组件比较复杂,这里提供打包好的 docker 使用, 启动 guacamole
Docker安装 (仅针对CentOS7,CentOS6安装Docker相对比较复杂)
卸载老版本的 docker 及其相关依赖
(py3) [root@jumpserver-server opt]
# yum remove docker docker-common container-selinux docker-latest-logrotate docker-logrotate docker-selinux docker-engine
(py3) [root@jumpserver-server opt]
# yum install -y yum-utils device-mapper-persistent-data lvm2
(py3) [root@jumpserver-server opt]
# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo //这是国内的阿里源,官方源为:yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
(py3) [root@jumpserver-server opt]
# yum-config-manager --enable docker-ce-edge
(py3) [root@jumpserver-server opt]
# yum-config-manager --enable docker-ce-test
(py3) [root@jumpserver-server opt]
# yum install docker-ce
(py3) [root@jumpserver-server opt]
# systemctl start docker
(py3) [root@jumpserver-server opt]
# systemctl status docker
5.3)启动 Guacamole(下面命令下载时间可能有点长,取决于带宽大小)。
这里所需要注意的是 guacamole 暴露出来的端口是 8081,若与主机上其他端口冲突请自定义。
修改JUMPSERVER_SERVER环境变量的配置,填上Jumpserver 的内网地址, 启动成功后去Jumpserver的web管理界面的
"会话管理"
-
"终端管理"
接受[Gua]开头的一个注册。
(py3) [root@jumpserver-server opt]
# docker run --name jms_guacamole -d -p 8081:8080 -v /opt/guacamole/key:/config/guacamole/key
-e JUMPSERVER_KEY_DIR=
/config/guacamole/key
-e JUMPSERVER_SERVER=http:
//192
.168.10.210:8080 registry.jumpserver.org
/public/guacamole
:1.0.0
(py3) [root@jumpserver-server opt]
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry.jumpserver.org
/public/guacamole
1.0.0 6300349f2642 5 days ago 1.23GB
(py3) [root@jumpserver-server opt]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b1f06c49a790 registry.jumpserver.org
/public/guacamole
:1.0.0
"/init"
3 minutes ago Up 3 minutes 0.0.0.0:8081->8080
/tcp
jms_guacamole
|
6)配置 Nginx 整合各组件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
6.1)安装Nginx
(py3) [root@jumpserver-server ~]
# yum -y install nginx
6.2)准备配置文件修改
/etc/nginx/conf
.d
/jumpserver
.conf
(py3) [root@jumpserver-server ~]
# cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
(py3) [root@jumpserver-server ~]
# vim /etc/nginx/nginx.conf
user www;
worker_processes 8;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
events {
worker_connections 65535;
}
http {
include mime.types;
default_type application
/octet-stream
;
charset utf-8;
log_format main
'$http_x_forwarded_for $remote_addr $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_cookie" $host $request_time'
;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
fastcgi_connect_timeout 3000;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;
fastcgi_buffer_size 256k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
client_header_timeout 600s;
client_body_timeout 600s;
client_max_body_size 100m;
client_body_buffer_size 256k;
## support more than 15 test environments
gzip
on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 9;
gzip_types text
/plain
application
/x-javascript
text
/css
application
/xml
text
/javascript
application
/x-httpd-php
;
gzip_vary on;
include
/etc/nginx/conf
.d/*.conf;
}
(py3) [root@jumpserver-server ~]
# useradd www
(py3) [root@jumpserver-server ~]
# echo " * soft nofile 65535" >> /etc/security/limits.conf
(py3) [root@jumpserver-server ~]
# echo " * hard nofile 65535" >> /etc/security/limits.conf
(py3) [root@jumpserver-server ~]
# echo " * soft nproc 102400" >> /etc/security/limits.conf
(py3) [root@jumpserver-server ~]
# echo " * hard nproc 102400" >> /etc/security/limits.conf
(py3) [root@jumpserver-server ~]
# ulimit -SHn 65535
(py3) [root@jumpserver-server ~]
# vim /etc/nginx/conf.d/jump.conf
server {
listen 80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location
/luna/
{
try_files $uri /
/index
.html;
alias
/opt/luna/
;
}
location
/media/
{
add_header Content-Encoding
gzip
;
root
/opt/jumpserver/data/
;
}
location
/static/
{
root
/opt/jumpserver/data/
;
}
location
/socket
.io/ {
proxy_pass http:
//localhost
:5000
/socket
.io/;
#如果coco安装在别的服务器,请填写它的ip
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection
"upgrade"
;
}
location
/guacamole/
{
proxy_pass http:
//localhost
:8081/;
#如果guacamole安装在别的服务器,请填写它的ip
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
access_log off;
}
location / {
proxy_pass http:
//localhost
:8080;
#如果jumpserver安装在别的服务器,请填写它的ip
}
}
6.3)运行Nginx
(py3) [root@jumpserver-server ~]
# nginx -t
(py3) [root@jumpserver-server ~]
# systemctl enable nginx
(py3) [root@jumpserver-server ~]
# systemctl start nginx
(py3) [root@jumpserver-server ~]
# systemctl status nginx
(py3) [root@jumpserver-server ~]
# lsof -i:80
(py3) [root@jumpserver-server ~]
# lsof -i:8080
(py3) [root@jumpserver-server ~]
# lsof -i:8081
6.4)访问 http:
//192
.168.10.210
//
最终要起来的端口分别是:80、8080、8081、5000、2222
|
使用其他用户(如wangshibo用户)登录jumpserver,通过webshell登录机器:
可以直接使用创建的jumpserver用户(比如wangshibo)及其密码(这个即是jumpserver管理界面的登录密码也是登录jumpserver终端的密码)和2222端口 登录jumpserver堡垒机终端:
使用webshell登录堡垒机的一个软肋就是不能直接使用rz、sz进行上传和下载操作,如果要想上传和下载文件,比较简单的方法就是:在添加的资源机器上统一创建一个临时账号,然后通过FileZilla或WinScp等工具将本机和linux直接进行文件上传和下载:
1
2
3
4
5
6
7
8
|
[root@centos6-test09 ~]
# mkdir /tmp/share
[root@centos6-test09 ~]
# useradd share -d /tmp/share
[root@centos6-test09 ~]
# cat /etc/passwd|grep share
share:x:503:503::
/tmp/share
:
/bin/bash
[root@centos6-test09 ~]
# echo "123456"|passwd --stdin share
[root@centos6-test09 ~]
# chmod -R 4777 /tmp/share //设置t权限
[root@centos6-test09 ~]
# ll -d /tmp/share
drwsrwxrwx. 2 root root 4096 Apr 1 06:21
/tmp/share
|
在终端里登录jumpserver堡垒机,会显示"*** 欢迎使用Jumpserver开源跳板机系统",这一段标识语可以自行修改,修改方法:
1
2
3
4
5
6
7
8
9
10
11
|
(py3) [root@jumpserver-server jumpserver]
# cd /opt/
(py3) [root@jumpserver-server opt]
# fgrep -R "欢迎使用Jumpserver开源跳板机系统" ./*
.
/coco/coco/interactive
.py: banner = _(
""
"\n {title} {user}, 欢迎使用Jumpserver开源跳板机系统 {end}\r\n\r
Binary
file
.
/coco/coco/__pycache__/interactive
.cpython-36.pyc matches
Binary
file
.
/jumpserver/
.git
/objects/pack/pack-3c43bf16d0fa157a5c748ba6137c11af858d79d0
.pack matches
Binary
file
.
/jumpserver/apps/i18n/zh/LC_MESSAGES/django
.mo matches
.
/jumpserver/apps/i18n/zh/LC_MESSAGES/django
.po:msgstr
"欢迎使用Jumpserver开源跳板机系统"
(py3) [root@jumpserver-server opt]
# ll /opt/coco/coco/interactive.py
-rw-r--r--. 1 root root 12357 Mar 31 13:52
/opt/coco/coco/interactive
.py
即在
/opt/coco/coco/interactive
.py文件里修改。
|
===========================================================
7)Jumpserver堡垒机添加Windows客户机资产的方法:
7.0)Windows主机需要提前做的操作
a)关闭防火墙(或者防火墙要运行rpd协议通过);
b)允许远程桌面连接;
c)要保证在jumpserver部署机器上能telnet windows主机的3389端口
1
2
3
4
|
[root@jumpserver-server ~]
# telnet 192.168.10.214 3389
Trying 192.168.10.214...
Connected to 192.168.10.214.
Escape character is
'^]'
.
|
7.1)创建 Windows 管理用户
同 Linux 系统的管理用户一样,名称可以按资产树来命名,用户名是管理员用户名,密码是管理员的密码(这个管理用户和密码要能真正成功登录windows主机的)。
7.2)创建 Windows 系统用户
由于目前 Windows 不支持自动推送,所以 Windows 的系统用户设置成与管理用户同一个用户(交换机、Windows等设备不支持 Ansible, 需手动填写账号密码)。Windows 资产协议务必选择 rdp,并且要去掉自动生成密钥、自动推送勾选。
7.3)创建 Windows 资产
同创建 Linux 资产一样。创建 Windows 资产,系统平台请选择正确的 Windows,端口号为3389,IP 和 管理用户请正确选择,确保管理用户能正确登录到指定的 IP 主机上。
7.4) Windows 资产创建授权规则
7.5)Windows 无法连接的问题及解决
a)如果白屏 可能是nginx配置文件的guacamole设置的不对,也可能运行guacamole的docker容器有问题,总之请求到不了guacamole
b)如果显示没有权限 可能是你在 终端管理里没有接受 guacamole的注册,请接受一下,如果还是不行,就删除刚才的注册,重启guacamole的docker重新注册
c)如果显示未知问题 可能是你的资产填写的端口不对,或者授权的系统用户的协议不是rdp
d)提示无法连接服务器,请联系管理员或查看日志 一般情况下是登录的系统账户不正确,可以从Windows的日志查看信息
e)提示网络问题无法连接或者超时,请检查网络连接并重试,或联系管理员 一般情况下是防火墙设置不正确,可以从Windows的日志查看信息
==========================================================================================
在如上步骤添加windows主机资产后,在Web终端里可以正常登录Linux主机,但是却不能正常登录Windows主机,报错如下:
产生的原因:在Jumpserver终端管理里没有成功接受guacamole的注册,如下图所示, guacamole注册后显示的是"不在线"状态!!!
解决办法:需要删除之前的guacamole注册,然后重启guacamole的docker服务,并且重新注册guacamole!必须保证guacamole注册后是"在线"状态!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
(py3) [root@jumpserver-server conf.d]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
658b243e1106 registry.jumpserver.org
/public/guacamole
:1.0.0
"/init"
21 hours ago Up 21 hours 0.0.0.0:8081->8080
/tcp
jms_guacamole
(py3) [root@jumpserver-server conf.d]
# docker rm -f `docker ps -a -q`
658b243e1106
(py3) [root@jumpserver-server conf.d]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(py3) [root@jumpserver-server conf.d]
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
(py3) [root@jumpserver-server conf.d]
# lsof -i:8081
(py3) [root@jumpserver-server conf.d]
#
(py3) [root@jumpserver-server conf.d]
# docker run --name jms_guacamole -d -p 8081:8080 -v /opt/guacamole/key:/config/guacamole/key -e JUMPSERVER_KEY_DIR=/config/guacamole/key -e JUMPSERVER_SERVER=http://192.168.10.210:8080 registry.jumpserver.org/public/guacamole:1.0.0
e8b976408ef41c1ddafe8d8b9d968c4886136aab9d53d7c75fd218b2725f6b29
(py3) [root@jumpserver-server conf.d]
# lsof -i:8081
COMMAND PID USER FD TYPE DEVICE SIZE
/OFF
NODE NAME
docker-
pr
11785 root 4u IPv6 549583 0t0 TCP *:tproxy (LISTEN)
(py3) [root@jumpserver-server conf.d]
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8b976408ef4 registry.jumpserver.org
/public/guacamole
:1.0.0
"/init"
8 seconds ago Up 6 seconds 0.0.0.0:8081->8080
/tcp
jms_guacamole
|
注册guacamole的时候,名称保持默认不变(即是以Gua开头的默认名称)!guacamole注册成功后,过一会儿,就会发现已经是"在线"状态了!
这样使用创建的非管理用户登录Jumpserver,从web终端里就能成功登录Windows主机了!