Last active
July 22, 2022 08:04
-
-
Save moeinrahimi/60c8f1590d84c76b56d6c539fc2dbf85 to your computer and use it in GitHub Desktop.
add new teleport node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CLIENT=teleport_7.3.3_amd64.deb | |
if ! hash teleport 2>/dev/null | |
then | |
wget https://get.gravitational.com/$CLIENT | |
sudo dpkg -i $CLIENT | |
fi | |
echo going to add a new new teleport node | |
AUTH_TOKEN=$1 | |
CA_PIN=$2 | |
AUTH_SERVER=$3 | |
LABEL=$4 | |
echo "teleport: | |
nodename: $HOSTNAME | |
auth_token: $AUTH_TOKEN | |
ca_pin: $CA_PIN | |
auth_servers: | |
- teleport.bentoapp.org | |
ssh_service: | |
enabled: true | |
labels: | |
env: $LABEL | |
commands: | |
- name: hostname | |
command: [hostname] | |
period: 1m0s | |
auth_service: | |
enabled: false | |
proxy_service: | |
enabled: false" > /etc/teleport.yaml | |
sudo teleport start& | |
sleep 5 | |
jobs | |
kill %1 | |
sudo systemctl enable teleport | |
sudo systemctl start teleport | |
echo setup done(check log to make sure)! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment