微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

堡垒机安装配置

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.

*密码:XXXXXX
其他帐号: 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://XXX.XXX.XXX.XXX:8080/core/auth/login/

账号: XXXXXXX

参考文档:
JumpServer Docs

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐