跳板机、堡垒机是未来工作环境中,远程连接必备设备或服务,我们不直接连接到服务器,而是通过跳板机或堡垒机来对服务器进行管理和控制
跳板机:简单的跳板工具
堡垒机:跳板工具+审计功能
堡垒机产品:jumpserver、teleport
1、项目实战
1)准备软件包
这里使用teleport软件,事先下载好Windows端和Linux端

2)安装
Windows端安装过程略。
Linux端(ip:192.168.10.100):
a)关闭防火墙和selinux:
[root@linux-87-01 ~]# systemctl stop firewalld #关闭防火墙
[root@linux-87-01 ~]# systemctl disable firewalld #取消开机启动防火墙
[root@linux-87-01 ~]# setenforce 0 #临时关闭selinux
要永久关闭selinux,则修改/etc/selinux/config文件,把SELINUX=enforcing改成SELINUX=disabled,然后重启系统即可。
b)解压:
[root@linux-87-01 ~]# tar xf teleport-server-linux-x64-3.6.4-b3.tar.gz
[root@linux-87-01 ~]# ll
total 31960
drwxr-xr-x. 5 1000 1000 62 Sep 13 2022 teleport-server-linux-x64-3.6.4-b3
-rw-r--r--. 1 root root 32717761 May 7 21:20 teleport-server-linux-x64-3.6.4-b3.tar.gz
[root@linux-87-01 ~]#
c)安装teleport
[root@linux-87-01 ~]# cd teleport-server-linux-x64-3.6.4-b3/
[root@linux-87-01 ~]# cd teleport-server-linux-x64-3.6.4-b3/ ./setup.sh
提示如下:

按回车即可,默认安装在:/usr/local/teleport
d)启动teleport服务
进入teleport安装目录:/usr/local/teleport
执行启动脚本即可:
[root@linux-87-01 teleport-server-linux-x64-3.6.4-b3]# cd /usr/local/teleport/
[root@linux-87-01 teleport]# ll
total 12
drwxr-xr-x. 3 root root 108 Sep 13 2022 bin
drwxr-xr-x. 6 root root 52 May 7 21:43 data
-rwxr-xr-x. 1 root root 1118 May 7 21:43 start.sh
-rwxr-xr-x. 1 root root 568 May 7 21:43 status.sh
-rwxr-xr-x. 1 root root 781 May 7 21:43 stop.sh
drwxr-xr-x. 4 root root 38 Sep 13 2022 www
[root@linux-87-01 teleport]# ./start.sh
starting teleport web ... already running, skip.
starting teleport core server ... already running, skip.
[root@linux-87-01 teleport]#
查看一下进程:
[root@linux-87-01 ~]# ps -ef | grep teleport
root 7927 1 0 21:43 ? 00:00:02 /usr/local/teleport/bin/tp_web start
root 7954 1 0 21:43 ? 00:00:00 /usr/local/teleport/bin/tp_core start
root 8230 8012 0 21:47 pts/0 00:00:00 grep --color=auto teleport
[root@linux-87-01 ~]#
e)web页面访问
浏览器输入:http://192.168.10.100:7190
则进入安装配置页面:

配置好密码等信息后,点击“开始配置”

刷新页面登录即可:

2、堡垒机使用
登录teleport成功后,页面如下:

然后安装Windows端(teleport-assist-windows-3.6.3.exe)即可。
2.1、添加主机


添加管理账号:
点击“操作”—>管理远程账号

确定即可。
2.2 连接主机
前面已经添加完主机和账号,现在就可以连接了。
点击”运维“—->主机运维—->SSH:

然后,就会弹出:

连接成功。默认使用的是PuTTY,不是Xshell连接工具。
2.3 回放功能
点击”审计“—>会话审计,就可以看到连接情况,有回放、日志

点击日志,就可以看到操作的记录了:

点击回放,就可以看到用户操作的过程。