安装堡垒机teleport、jumperserver

骆照
2023-12-01

teleport

  1. wget https://get.gravitational.com/teleport_4.3.5_amd64.deb

  2. chmod +x ./teleport_4.3.5_amd64.deb

  3. apt install ./teleport_4.3.5_amd64.deb

  4. docker 启动 teleport

sudo mkdir -p /usr/local/teleport

docker run -d --privileged --hostname tomas --name teleport -v /usr/local/teleport:/etc/teleport -p 3023:3023 -p 3025:3025 -p 3080:3080 quay.io/gravitational/teleport:4.3.5

  1. 禁用二次token
# 编辑teleport.yml, 重启teleport
auth_service:
  authentication:
    type: local
    second_factor: off

  1. 创建账号
# 登陆容器
sudo docker exec -it 13057caa9f8c /bin/bas
# 新建用户
tctl users add tomas tomas,root
# 根据提示配置密钥
User tomas has been created but requires a password. Share this URL with the user to complete user setup, link is valid for 1h0m0s:
https://tomas:3080/web/invite/cca1df033379120b53cea8d6f50f2ead

NOTE: Make sure tomas:3080 points at a Teleport proxy which users can access.

密码:apulis18c
其他帐号: teleport/teleport

JumpServer

  1. Linux 生成随机key
# vim init_key.sh
if [ ! "$SECRET_KEY" ]; then
  SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`;
  echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc;
  echo $SECRET_KEY;
else
  echo $SECRET_KEY;
fi  
if [ ! "$BOOTSTRAP_TOKEN" ]; then
  BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`;
  echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc;
  echo $BOOTSTRAP_TOKEN;
else
  echo $BOOTSTRAP_TOKEN;
fi

生成key:

chmod +x init_key.sh
./init_key.sh

cRPylgC5zy6JtEbjzyduH21PdULrdi4N55fJrkQfj9Vxdtd8Np
9n5vCVTD7BQwOWE1
  1. docker 部署
docker run --name jms_all -d \
  -p 8080:80 -p 2222:2222 \
  -e SECRET_KEY=$SECRET_KEY \
  -e BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN \
  -v /opt/jumpserver/data:/opt/jumpserver/data \
  -v /opt/jumpserver/mysql:/var/lib/mysql \
  --privileged=true \
  jumpserver/jms_all:v2.2.1
  1. 登陆

链接: http://121.46.18.83:8080/core/auth/login/

账号: admin apulis18D

参考文档:
JumpServer Docs

 类似资料: