wget https://get.gravitational.com/teleport_4.3.5_amd64.deb
chmod +x ./teleport_4.3.5_amd64.deb
apt install ./teleport_4.3.5_amd64.deb
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
# 编辑teleport.yml, 重启teleport
auth_service:
authentication:
type: local
second_factor: off
# 登陆容器
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
# 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
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
链接: http://XXX.XXX.XXX.XXX:8080/core/auth/login/
账号: XXXXXXX
参考文档:
JumpServer Docs