Teleport installation:
For more information, you can go to the original website, or you can use the below code library
Prerequisites:
443
open to ingress traffic. You must be able to install and run software on the machine. Either configure access to your machine via SSH for the initial setup (and open an SSH port in addition port 443
) or enter the commands in this guide into an Amazon EC2 user data script, Google Compute Engine startup script, or similar.You must also have one of the following:
Configure DNS:
Teleport uses TLS to provide secure access to its Proxy Service and Auth Service, and this requires a domain name that clients can use to verify Teleport's certificate.
Set up two A
DNS records: tele.example.com
for all traffic and *.tele.example.com
for web apps using Application Access. We are assuming that your domain name is example.com
. Use your own subdomain instead of tele
.
Now we can install the Teleport
sudo curl https://apt.releases.teleport.dev/gpg \
-o /usr/share/keyrings/teleport-archive-keyring.asc
source /etc/os-release
echo "deb [signed-by=/usr/share/keyrings/teleport-archive-keyring.asc] \
https://apt.releases.teleport.dev/${ID?} ${VERSION_CODENAME?} stable/v12" \
| sudo tee /etc/apt/sources.list.d/teleport.list > /dev/null
sudo apt-get update
sudo apt-get install teleport
teleport configure --acme [email protected] --cluster-name=tele.example.com | \
sudo tee /etc/teleport.yaml > /dev/null
Add your application to the teleport YML file:
sudo nano /etc/teleport.yaml
Place the below code into the above yaml file and below the ssh_service section
app_service:
enabled: yes
apps:
- name: "demo"
uri: "http://localhost:9000"
public_addr: "demo.teleport.example.com"
Start Teleport:
sudo systemctl start teleport
Now, by using the script I am going to install the Docker and Portainer service because I want to publish that Portainer console as an example via this amazing solution, since NPM and Teleport both are using the port 443 so we cannot install them in one server.
mkdir docker && cd docker
wget https://library.ahadiani.ca/install_docker_nproxyman.sh
chmod +x install_docker_nproxyman.sh
./install_docker_nproxyman.sh
Now you can browse the teleport login page via URL but since we don't have the required credentials lets go and create a user for Teleport and set up two-factor authentication:
sudo tctl users add teleport-admin --roles=editor,access --logins=root,ubuntu,ec2-user
The system will give you a link that you can use to create your username…
Like the below example link:
https://teleport.example.com:443/web/invite/123abc456def789ghi123abc456def78
For more information visit this link.