# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) # uname -r 3.10.0-693.21.1.el7.x86_64
下載最新的teleport安裝包(teleport-server-linux-x64-3.0.1.6.tar),放到/usr/src目錄下並執行下列命令:mysql
# wget http://teleport.eomsoft.net/static/download/teleport-server-linux-x64-3.0.1.6.tar.gz # tar zxvf teleport-server-linux-x64-3.0.1.6.tar # cd teleport-server-linux-x64-3.0.1.6.tar # ./setup.sh
僅需幾秒鐘,安裝就已完成,而且teleport服務也成功啓動運行了
如今,您的堡壘機已經準備就緒,能夠訪問了linux
請訪問 http://您的堡壘機IP地址:7190 進行配置管理。默認管理員帳號 admin,默認管理員密碼 admin。
安裝完成後,請以管理員身份登陸,首次安裝的系統會進行數據庫的建立和初始化操做,完成以後刷新頁面便可進入teleport主界面。nginx
啓動teleport服務:web
# /etc/init.d/teleport start
中止teleport服務:sql
# /etc/init.d/teleport stop
從新啓動teleport服務:數據庫
# /etc/init.d/teleport restart
查看Teleport服務的運行情況:vim
# /etc/init.d/teleport status
默認狀況下,teleport的WEB服務使用7190端口,安裝後可按以下地址訪問:
http://您的堡壘機IP地址:7190
若是您須要更改默認端口號,請修改配置文件(注意,兩個配置文件均涉及到web端口,要一併修改)。瀏覽器
# /usr/local/teleport/data/etc/web.ini # /usr/local/teleport/data/etc/core.ini
重要提示:修改完配置文件後,須要從新啓動teleport服務使修改生效!服務器
監聽地址 | 端口號 | 用途 | 備註 |
---|---|---|---|
localhost | 52080 | 提供給WEB後臺的RPC接口 | 本機跨進程通信建議不作修改 |
0.0.0.0 | 52089 | 提供RDP跳轉服務 | 對外提供RDP跳轉服務能夠不作修改 |
0.0.0.0 | 52189 | 提供SSH跳轉服務 | 對外提供SSH跳轉服務能夠不作修改 |
Teleport在默認端口配置下便可正常工做,可是在某些狀況下,可能須要修改端口號來匹配您公司的防火牆策略,您能夠在配置文件中進行設置。網絡
系統中沒有默認的運維人員帳號,須要由管理員添加用戶,方可登陸。新建立的用戶,請登陸綁定郵箱,獲取帳號密碼,如若忘記密碼,能夠在登陸界面選擇忘記密碼,輸入帳號,綁定郵箱,登陸綁定郵箱點擊重置連接,從新設置登陸密碼(密碼長度不得少於8位,且必須包含字母大小寫及數字)
遠程助手
點擊主機信息右側的「遠程」按鈕,能夠進行遠程鏈接。可是在第一次使用遠程鏈接時,會跳出如下對話框:
須要下載並運行 遠程助手
官網下載地址:http://teleport.eomsoft.net/download
安裝完成後雙擊啓動它(您能夠在系統托盤區看到助手小圖標)。啓動以後,刷新主機管理頁面。
鏈接主機
點擊 遠程 按鈕,助手會打開對應的客戶端軟件進行遠程鏈接。
SSH:
RDP:
助手設置
助手設置默認的SSH鏈接和Telnet鏈接是Putty,SFTP鏈接是WinSCP,RDP鏈接是FreeRDP。
點擊紅框內的助手設置能夠選擇其餘鏈接工具代替。
完成後保存便可
# yum install -y mariadb mariadb-devel mariadb-server
運行mysql
# systemctl start mariadb
設置開機啓動
# systemctl enable mariadb
初始化設置帳號密碼
mysql_secure_installation
root初始密碼爲空,設置root密碼並禁止root遠程登錄,刪除guest等
# vim /etc/my.cnf
在[mysqld]標籤下添加
init_connect='SET collation_connection = utf8_unicode_ci' init_connect='SET NAMES utf8' character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake
# vim /etc/my.cnf.d/client.cnf
在[client]中添加
default-character-set=utf8
# vim /etc/my.cnf.d/mysql-clients.cnf
在[mysql]中添加
default-character-set=utf8
重啓mysql
# systemctl restart mariadb
進入mysql查看是否配置正確
> show variables like "%character%";show variables like "%collation%";
創建數據庫新用戶(teleport)
> create user teleport@localhost identified by '123456';
創建新實例(teleport)
> create database teleport;
賦予用戶權限
> grant all privileges on teleport.* to teleport@localhost identified by '123456' with grant option;
用戶名是teleport,密碼是123456.
接下來咱們須要更改配置文件將mariadb數據庫的一些信息填入。
配置文件的默認路徑是/usr/local/teleport/data/etc,咱們須要編輯文件web.ini.
# cp /usr/local/teleport/data/etc/web.ini /usr/local/teleport/data/etc/web.ini.bak #先備份配置文件
編輯配置文件web.ini
重啓teleport:
# /etc/init.d/teleport restart
vim /usr/local/teleport/www/teleport/static/js/ui/log.js
if (protocol === PROTOCOL_TYPE_RDP) { $(cell_obj).find('[ywl-btn-record]').click(function () { var ip = window.location.hostname; var port = parseInt(window.location.port); var url = 'http://' + ip + ':' + port + '/log/replay/rdp/' + row_data.id; var tail = 'log/replay/rdp/' + prefixInteger(row_data.id, 6); var args = {}; args.id = parseInt(row_data.id); args.host = ip; args.port = port; args.tail = tail; args.url = url; start_rdp_replay(args, function () { ywl.notify_success('RDP 錄像播放器成功啓動!'); }, function (code, msg) { if (code === TPE_NO_ASSIST) g_assist.alert_assist_not_found(); else { ywl.notify_error(msg); console.log('error:', msg) } }); });
將代碼中的 args.port = port 改成 if(port){ args.port = port;} else{ args.port = 80;}
因業務需求,須要將原有teleport遷移到新的虛擬機,其思路以下:環境配置+數據庫導出導入,如果阿里雲機器,還須要放開對應的端口
# mysqldump -uroot -p teleport > teleport.sql
能夠將導出的數據庫文件下載到本地後再上傳到新機器,或者經過命令scp teleport.sql root@x.x.x.x:/root傳到新的機器上(確保兩臺臺機器是互通的)
# mysql -uroot -p teleport < teleport.sql
添加反向代理
安裝nginx
# yum install -y nginx
添加nginx代理配置文件ops.conf,
vim /etc/nginx/conf.d/ops.conf
...略 server { listen 80; location / { proxy_pass http://x.x.x.x:7190; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
保存,重啓nginx。瀏覽器輸入地址:http://IP地址 便可