Fork me on GitHub

堡垒机-teleport的安装以及常见问题解决办法

  teleport是一款简单易用的堡垒机系统,运用在企业对windows.linux服务器的安全使用管理以及审计。

官网网址:http://teleport.eomsoft.net/ github地址:https://github.com/eomsoft/teleport

我接下来讲解和安装的是2.2.10版本,官网有3.0版本但是还是预览版有些功能没有完善。

teleport的windows远程是基于rdp,linux是基于ssh.

teleport2.2.10版本的安装很简单:

目前只支持部署到Linux系统中去,支持以下版本:

  • Ubuntu 14.04 64位 及以上版本
  • CentOS 6.2 64位 及以上版本
  • Debian 6.0 64位 及以上版本
  • Redhat 6.2 64位 及以上版本

我的安装环境是:centos7

下载安装包:

cd /tmp
wget http://teleport.eomsoft.net/static/download/opensource/teleport-server-linux-x64-2.2.10.1.tar.gz

 解压安装包:

tar -zxvf teleport-server-linux-x64-2.2.10.1.tar.gz
cd teleport-server-linux-x64-2.2.10.1/
sudo ./setup.sh

 

 

  默认的安装路径是/usr/local/teleport.以上就安装完成了,接下来我们需要开放一些端口以保证服务的正常运行。

firewall-cmd --add-port=7190/tcp --permanent (web访问端口7190)
firewall-cmd --add-port=52080/tcp --permanent(web后台RPC接口)
firewall-cmd --add-port=52089/tcp --permanent(RDP跳转服务)
firewall-cmd --add-port=52189/tcp --permanent(ssh跳转服务)
firewall-cmd --reload 

 teleport默认使用的数据库是sqlite,它也支持mysql,由于对sqlite不太熟悉,我这边使用的mariadb(从centos7开始mariadb为默认的数据库了)。

mariadb的安装这边我就不讲了,我这边以安装好了讲起。首先第一步我们需要创建teleport的数据库

CREATE database teleport  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

 第二我们需要创建一个用户对teleport数据库有权限读写。

grant all privileges on teleport.* to teleport@'localhost' identified  by ‘123456';

  用户名是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:

sudo /etc/init.d/teleport  restart 

 有关teleport的命令

sudo /etc/init.d/teleport start(启动)
sudo /etc/init.d/teleport stop(暂停)
sudo /etc/init.d/teleport restart(重启)
sudo /etc/init.d/teleport status(查看运行状态)

  启动完后我们访问http://您的堡垒机IP地址:7190,用户名是admin密码是admin.

然后点击开始创建数据库即可。

安装就讲到这里。

一个完整的teleport少不了tp助手,我们需要去官网下载tp助手进行安装。每次打开teleport网站它会检查我们的tp助手是否在运行。

接下来讲讲我在使用中遇到的问题以及解决办法:

  第一个问题就是通过TP助手连接我们的远程windows发现只可以复制文件不可以用剪切板。

原因是tp助手集成的freerdp不带有这个功能,如果我们使用需要剪切板的话需要自己手动升级下freerdp,具体步骤是:先去官网下载freerdp地址是:https://ci.freerdp.com/job/freerdp-nightly-windows/ 选择你对应的系统位数进行下载。这里我提供一个64位的链接:https://ci.freerdp.com/job/freerdp-nightly-windows/arch=win64,label=vs2013/lastSuccessfulBuild/artifact/build/Release/wfreerdp.exe

然后去我们的tp助手的安装目录找到tools-->tprdp-->tprdp-client.exe 然后将我们刚才下载的复制进来进行替换(注意是替换tprdp-client.exe,替换后名称要是tprdp-client哦。)注意亲测win7替换后没有用,win10替换后可以使用剪切板。

  第二个问题就是核心服务崩溃

核心服务崩溃应该算是一个bug,如何解决?我们可以写个脚本,定时检查我们的teleport状态,如果状态是核心服务崩溃就重启teleport.并记录日志。

脚本为:

#!/bin/bash/
#######################################################
# $Name:        teleport_check.sh
# $Version:     v1.0
# $Function:    check teleport status
# $Author:      djx
# $Create Date: 2017-11-8
# $Description: shell
######################################################
#注意此脚本未加文件锁
Teleport_command=/etc/init.d/teleport
#日志文件路径
Teleport_log=/var/log/teleport/teleport_check.log
Teleport_status=`${Teleport_command} status |awk '{print $5$6}' |grep 'notrunning.'`
if [ "$?" -eq  0 ]
then
        echo "$(date +%F_%T)" >> ${Teleport_log}
        echo "$(${Teleport_command} status)" >>${Teleport_log}
        $Teleport_command restart
        echo "$(${Teleport_command} status)" >>${Teleport_log}

else
        echo ""
fi

 然后将此脚本添加到计划任务,按照实际情况设定间隔检查的分钟数。

  第三个问题就是rdp客户端连接win2008以上服务器失败,日志提示“协议不支持”。

服务器端打开  计算机-属性-远程设置,将默认的“仅允许运行使用网络级别身份验证的远程桌面的计算机连接”,更改为“允许运行任意版本远程桌面的计算机连接” 即可正常连接

 

posted @ 2018-03-08 15:41  自由早晚乱余生  阅读(10225)  评论(0编辑  收藏  举报