-
-
Save dante11235/d43a3373eae6b28c25b7ccd730826739 to your computer and use it in GitHub Desktop.
Script to install Teleport on a system
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 | |
export version=v8.0.7 | |
export os=linux | |
export arch=amd64 | |
##################################### | |
curl -O https://get.gravitational.com/teleport-$version-$os-$arch-bin.tar.gz | |
tar -xzf teleport-$version-$os-$arch-bin.tar.gz | |
cd teleport | |
./install | |
##################################### | |
mkdir -p /var/lib/teleport | |
##################################### | |
cat > /etc/systemd/system/teleport.service <<- "EOF" | |
[Unit] | |
Description=Teleport SSH Service | |
After=network.target | |
[Service] | |
Type=simple | |
Restart=on-failure | |
EnvironmentFile=-/etc/default/teleport | |
ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --pid-file=/var/run/teleport.pid | |
ExecReload=/bin/kill -HUP $MAINPID | |
PIDFile=/run/teleport.pid | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
##################################### | |
cat > /etc/teleport.yaml <<- "EOF" | |
teleport: | |
nodename: <<REDACTED>> | |
auth_token: <<REDACTED>> | |
auth_servers: | |
- tele.robto.it:3025 | |
data_dir: /var/lib/teleport | |
proxy_service: | |
enabled: "no" | |
auth_service: | |
enabled: "no" | |
ssh_service: | |
enabled: "yes" | |
commands: | |
- name: arch | |
command: [/bin/uname, -p] | |
period: 1h0m0s | |
- name: hostname | |
command: [/bin/hostname] | |
period: 1m0s | |
EOF | |
##################################### | |
systemctl daemon-reload | |
systemctl enable teleport | |
systemctl start teleport | |
##################################### |
for example
tctl nodes add --ttl=5m --roles=node,proxy --token=secret-value
you choose any name you want
and add the token generated from command obove
Hello,
Would it be possible to buy your email address? Thx
Roman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the <> parts how do we get the auth_token?