Jumpserver最新版本支持windows組件,廢話很少介紹了,下面直接介紹下部署過程:javascript
0)系統環境php
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虛擬環境css
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.0html
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_USER = 'monit@kevin.com' 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前端
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 "wangshibo@kevin.com" 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 wangshibo@kevin.com 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: Cocojava
新開一個終端,別忘了"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項目就會是"在線"狀態中的!node
4.4)測試鏈接python
要保證2222端口是啓動着的。而後進行堡壘機的鏈接測試,可使用默認的admin用戶或上面本身建立的wangshibo用戶。 注意這些用戶建立後不會再jumpserver部署機裏自動建立成系統用戶(可是3.0以前的jumpserver會在部署機上自動建立) (py3) [root@jump-v4 coco]# ssh -p2222 admin@192.168.10.210 //admin的密碼默認是admin ...... admin@192.168.10.210'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登陸的話,語法以下 $ssh admin@192.168.10.210 2222 密碼: admin 若是能登錄表明部署成功 ------------------------------------------------
5)安裝 Web Terminal: Lunamysql
新開一個終端,鏈接測試機,別忘了"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 整合各組件linux
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<br> server_names_hash_max_size 512;<br> server_names_hash_bucket_size 128;<br> 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、808一、5000、2222
使用其餘用戶(如wangshibo用戶)登陸jumpserver,經過webshell登陸機器:
能夠直接使用建立的jumpserver用戶(好比wangshibo)及其密碼(這個便是jumpserver管理界面的登陸密碼也是登陸jumpserver終端的密碼)和2222端口 登陸jumpserver堡壘機終端:
使用webshell登陸堡壘機的一個軟肋就是不能直接使用rz、sz進行上傳和下載操做,若是要想上傳和下載文件,比較簡單的方法就是:在添加的資源機器上統一建立一個臨時帳號,而後經過FileZilla或WinScp等工具將本機和linux直接進行文件上傳和下載:
[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開源跳板機系統",這一段標識語能夠自行修改,修改方法:
(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端口
[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註冊後是"在線"狀態!
(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主機了!