企业实战(18)两步搞定轻量级开源堡垒机Teleport服务的数据备份与升级(3)

简介: 企业实战(18)两步搞定轻量级开源堡垒机Teleport服务的数据备份与升级(3)

部署篇-->传送门:企业实战(18)一文搞懂轻量级开源堡垒机Teleport的部署(1)


管理主机篇-->传送门:企业实战(18)超简单实现轻量级开源堡垒机Teleport管理Linux/Windows主机(2)


介绍:


Teleport是一款简单易用的开源堡垒机系统,具有小巧、易用的特点,支持 RDP/SSH/SFTP/Telnet 协议的远程连接和审计管理。


Teleport由两大部分构成:


  • 跳板核心服务


  • WEB操作界面


Teleport非常小巧且极易安装部署:仅需一分钟,就可以安装部署一套您自己的堡垒机系统!


因为Teleport内建了所需的脚本引擎、WEB服务等模块,因此不需要额外安装其他的库或者模块,整个系统的安装与部署非常方便。


特点:


- 极易部署


  简洁设计,小巧灵活,无额外依赖,确保您可以在5分钟内完成安装部署,开始使用。


- 安全增强


  配置远程主机为仅被您的teleport服务器连接,可有效降低嗅探、扫描、暴力破解等攻击风险。


- 单点登录


  只需登录您的teleport服务器,即可一键连接您的任意远程主机,无需记忆每台远程主机的密码了。


- 按需授权


  可以随时授权指定运维人员访问指定的远程主机,也可随时回收授权。仅仅需要几次点击!


- 运维审计


  对远程主机的操作均有详细记录,支持操作记录录像、回放,审计工作无负担。


环境:


CentOS 7.5


Teleport 3.2.2


部署:


Teleport的安装部署非常简单,只需一分钟就可以完成。您需要先下载二进制安装包。


Teleport下载:https://tp4a.com/download


Teleport在线文档:https://docs.tp4a.com/


Teleport的安装部署非常简单,只需一分钟就可以完成。您需要先下载二进制安装包。


Teleport下载:https://tp4a.com/download


Teleport在线文档:https://docs.tp4a.com/


1.下载Teleport服务端安装包

[root@localhost ~]# mkdir teleport
[root@localhost ~]# cd teleport
[root@localhost teleport]# wget https://tp4a.com/static/download/teleport-server-linux-x64-3.2.2.tar.gz //下载Teleport服务端安装包
--2020-08-25 20:26:43-- https://tp4a.com/static/download/teleport-server-linux-x64-3.2.2.tar.gz
正在解析主机 tp4a.com (tp4a.com)... 39.97.125.170
正在连接 tp4a.com (tp4a.com)|39.97.125.170|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:23137304 (22M) [application/octet-stream]
正在保存至: “teleport-server-linux-x64-3.2.2.tar.gz”
100%[============================================================>] 23,137,304 1.34MB/s 用时 19s
2020-08-25 20:27:03 (1.17 MB/s) - 已保存 “teleport-server-linux-x64-3.2.2.tar.gz” [23137304/23137304])
[root@localhost teleport]# ll
总用量 22596
-rw-r--r-- 1 root root 23137304 1月 23 2019 teleport-server-linux-x64-3.2.2.tar.gz

2.关闭防火墙

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# sed -i 's/enforcing/disabled/' /etc/selinux/config
[root@localhost ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     disabled - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of disabled.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled         //永久关闭
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# iptables -F     //最好是把iptables规则也清空

3.解压Teleport服务端安装包


[root@localhost teleport]# tar -zvxf teleport-server-linux-x64-3.2.2.tar.gz
teleport-server-linux-x64-3.2.2/
teleport-server-linux-x64-3.2.2/data/
teleport-server-linux-x64-3.2.2/data/www/
teleport-server-linux-x64-3.2.2/data/www/teleport/
teleport-server-linux-x64-3.2.2/data/www/teleport/app_bootstrap.py
teleport-server-linux-x64-3.2.2/data/www/teleport/res/
teleport-server-linux-x64-3.2.2/data/www/teleport/res/fonts/
teleport-server-linux-x64-3.2.2/data/www/teleport/res/fonts/001.ttf
teleport-server-linux-x64-3.2.2/data/www/teleport/static/
teleport-server-linux-x64-3.2.2/data/www/teleport/static/css/
teleport-server-linux-x64-3.2.2/data/www/teleport/static/css/login.css
teleport-server-linux-x64-3.2.2/data/www/teleport/static/css/single.css
teleport-server-linux-x64-3.2.2/data/www/teleport/static/css/style.css
teleport-server-linux-x64-3.2.2/data/www/teleport/static/css/dashboard.css

4.查看并执行Teleport安装脚本


  安装时需要指定安装路径,可以使用默认的安装路径/usr/local/teleport(直接回车即可),也可以指定别的路径。注意路径中不要含有中文字符或空格,以避免出现不可预知的错误。


  默认的录像回放文件位于/usr/local/teleport/data/replay目录下,会占用/usr的空间,因此建议安装完成后配置录像回放文件的存储路径。


[root@localhost teleport]# ll
总用量 22596
drwxrwxr-x 5 1000 1000       62 1月 23 2019 teleport-server-linux-x64-3.2.2
-rw-r--r-- 1 root root 23137304 1月 23 2019 teleport-server-linux-x64-3.2.2.tar.gz
[root@localhost teleport]# cd teleport-server-linux-x64-3.2.2
[root@localhost teleport-server-linux-x64-3.2.2]# ll
总用量 4
drwxrwxr-x 2 1000 1000 80 9月 17 2018 daemon
drwxrwxr-x 5 1000 1000 39 1月 23 2019 data
drwxrwxr-x 3 1000 1000 33 1月 10 2019 script
-rwxrwxr-x 1 1000 1000 320 1月 23 2019 setup.sh
[root@localhost teleport-server-linux-x64-3.2.2]# ./setup.sh   //执行安装脚本
[]===========================================================================[]
| Teleport Server Installation                                             |
|===========================================================================|
|   ver: 3.2.2                                                             |
| author: apex.liu@qq.com                                                   |
[]===========================================================================[]
Welcome to install Teleport Server!
NOTICE: There are a few steps need you enter information or make choice,
      if you want to use the DEFAULT choice, just press `Enter` key.
      Otherwise you need enter the highlight character to make choice.
Prepare installation...
- check local installation ... [not exists]
Set installation path [/usr/local/teleport]:                   //默认的安装路径(回车)
- copy [/root/teleport/teleport-server-linux-x64-3.2.2/data/bin]
    -> [/usr/local/teleport/bin]
- copy [/root/teleport/teleport-server-linux-x64-3.2.2/data/www]
    -> [/usr/local/teleport/www]
- copy [/root/teleport/teleport-server-linux-x64-3.2.2/data/tmp/etc]
    -> [/usr/local/teleport/data/etc]
process [daemon.in] to [/etc/init.d/teleport]
process [start.sh.in] to [/usr/local/teleport/start.sh]
process [stop.sh.in] to [/usr/local/teleport/stop.sh]
process [status.sh.in] to [/usr/local/teleport/status.sh]
start services...
starting teleport web ... [done]
starting teleport core server ... [done]
check services status...
teleport web server is running.
teleport core server is running.
--==[ ALL DONE ]==--

5.访问进行初始化配置


  初次安装完成后,可以访问 http://你的teleport服务器IP:7190/进行初始化设置。

[root@localhost ~]# ss -antulp | grep :7190
tcp   LISTEN     0     128       *:7190                 *:*                   users:(("tp_web",pid=2917,fd=5))


初始化设置时,需要确定使用的数据库类型。Teleport默认使用内建的sqlite3数据库,因此无需额外安装数据库服务即可开始使用堡垒机的各项功能。如果您希望使用MySQL数据库,请在初始化之前进行MySQL数据库配置。

27.png

需要在这里设置系统管理员的账号和密码,此账号具有系统的最高权限,请牢记密码。设置完成后,点击“开始配置”按钮即可完成初始配置工作了:

28.png29.png

初始化配置完成后,刷新页面即可进入teleport的登录界面。

30.png

服务控制:


Teleport 有两个服务:核心服务 core 和网页服务 web。两个服务可以同时启动、停止、重启,也可单独操作其中的一个。


操作完整的 teleport 服务:


  • 启动:/etc/init.d/teleport start


  • 停止:/etc/init.d/teleport stop


  • 重启:/etc/init.d/teleport restart


  • 查看运行状态:/etc/init.d/teleport status


仅操作核心服务 core:


  • 启动:/etc/init.d/teleport start core


  • 停止:/etc/init.d/teleport stop core


  • 重启:/etc/init.d/teleport restart core


仅操作网页服务 web:


  • 启动:/etc/init.d/teleport start web


  • 停止:/etc/init.d/teleport stop web


  • 重启:/etc/init.d/teleport restart web

升级:


注意:升级之前,请确保备份了您的数据!!升级过程中也会再次提示您备份数据!


1 备份数据


    默认情况下,teleport的配置文件、数据文件等均放在 /usr/local/teleport/data 目录下,因此,可以将此目录进行备份即可。需要注意的是,默认的录像回放文件也在此目录下,因此有可能数据量会比较大。


2 下载并升级


   Teleport安装包下载:https://tp4a.com/download


   备份完成后,就可以进行升级了。升级过程也很简单,与安装过程基本一致。需要下载最新的安装包,解压,然后以 root 身份运行压缩包中的 setup.sh 脚本,像这样:


wget https://www.tp4a.com/static/download/teleport-server-linux-x64-3.2.2.tar.gz

(下载要新版本的服务端安装包)


tar -zxvf teleport-server-linux-x64-3.2.2.tar.gz


cd teleport-server-linux-x64-3.2.2


./setup.sh


  安装脚本会自动检测当前已经安装的版本和路径,并询问要执行的操作。这里我们要升级,按提示,输入 g 并回车,然后会确认升级以及确认已经对数据进行了备份,这里我们输入 y 并回车进行确认,之后,安装脚本会停止teleport的服务,复制新版本的文件,然后重新启动服务,就像这样:

31.png

相关文章
|
1月前
|
运维 安全 Linux
如何在Linux部署JumpServer堡垒机并实现远程访问本地服务
如何在Linux部署JumpServer堡垒机并实现远程访问本地服务
123 0
|
1月前
|
运维 安全 Linux
开源堡垒机JumpServer本地安装并配置公网访问地址
开源堡垒机JumpServer本地安装并配置公网访问地址
205 0
|
8月前
|
运维 安全 Linux
企业实战(18)超简单实现轻量级开源堡垒机Teleport管理Linux/Windows主机(2)
企业实战(18)超简单实现轻量级开源堡垒机Teleport管理Linux/Windows主机(2)
|
8月前
|
运维 前端开发 安全
企业实战(18)一文搞懂轻量级开源堡垒机Teleport的部署(1)
企业实战(18)一文搞懂轻量级开源堡垒机Teleport的部署(1)
244 0
企业实战(18)一文搞懂轻量级开源堡垒机Teleport的部署(1)
|
运维 前端开发 Linux
CentOS7下部署JumpServer开源堡垒机
CentOS7下部署JumpServer开源堡垒机
340 0
CentOS7下部署JumpServer开源堡垒机
|
运维 网络安全 数据安全/隐私保护
麒麟开源堡垒机安装部署测试及优缺点总结
近期出于管理和检查需要,单位领导要求上堡垒机系统,测试了几个商业堡垒机,因为价格超过预算等原因都未购买,又测试了三个开源的堡垒机,感觉麒麟开源堡垒机功能最全,基本上和商业堡垒机一样,唯一的问题就是图形部分不开源,但因为我们的服务器基本上全是LINUX环境,TELNET、SSH、FTP、SFTP已
9830 0
|
Linux Unix
开源堡垒机参考
http://0xcc.net/ttyrec/index.html.en 这是一个与 script 有着异曲同工之妙的小工具。
998 0
|
8月前
|
运维 安全 Linux
实现远程访问Linux堡垒机:通过JumpServer系统进行安全的服务器管理
实现远程访问Linux堡垒机:通过JumpServer系统进行安全的服务器管理