Accessing better.care infrastructure with Teleport

This guide is for engineers at better.care who use the internal Teleport cluster to reach SSH nodes, Kubernetes clusters, databases and web/TCP apps. This page covers the concepts (clusters, labels) and the daily tsh cheat-sheet; the task-specific walkthroughs live on sub-pages:

I want to… Page

Install the client and log in for the first time

Setup — install Teleport Connect & first login

SSH from the terminal, JetBrains or VS Code; forward ports

SSH, IDEs & port forwarding

Use kubectl / k9s / Helm against every Kubernetes cluster I have access to

Kubernetes: kubeconfig for all clusters

Connect to a database (PostgreSQL, MySQL, Oracle, SQL Server)

Databases

Open an internal web app or hit an API with curl/Bruno

Web & TCP apps

Do everything from a desktop app instead of a terminal

Teleport Connect (GUI)

1. What is Teleport?

Teleport is the single sign-in front door to better.care’s internal infrastructure. Instead of managing personal SSH keys, kubeconfigs and database credentials, you authenticate once to the Teleport cluster (the fleet of servers Teleport protects, fronted by a proxy) and Teleport issues you a short-lived certificate that grants access to whatever the platform team has authorised.

Key properties:

  • One login (password + 2FA) for SSH, Kubernetes, databases and apps.

  • No long-lived SSH keys on your laptop — certs expire automatically.

  • Every session is audited and recorded.

The proxy is reachable at teleport.better.care:443.

2. How access is organised — clusters and labels

This section is the minimum vocabulary you need so that tsh ls output makes sense. You don’t have to configure any of this — the platform team does — but recognising the pieces makes daily navigation much faster.

2.1. Root vs. leaf clusters

You log in to teleport.better.care — that’s the root cluster. Some sites are run as their own Teleport installations that the root has a trust relationship with; these are called leaf clusters. If the platform team has provisioned leaf clusters for you, you’ll see them in tsh clusters.

Your roles decide which (if any) leaf clusters you can reach. When you do have access, the same tsh session — and the same Teleport Connect window — works against the leaf; you just point at the leaf cluster name.

On a leaf cluster, the Linux user you log in as is set by the leaf’s admin (not your own username). Ask the platform team if you’re unsure which login to use.

To list nodes in a leaf cluster from the CLI:

tsh clusters                                        # root + leaf clusters you can reach
tsh ls --cluster=<leaf-cluster>                     # list nodes in a leaf
tsh ssh <predefined-login>@<node> --cluster=<leaf-cluster>

The GUI equivalent — the cluster picker in Teleport Connect’s top-left corner — is covered in Teleport Connect (GUI).

2.2. Labels

Every node and Kubernetes cluster carries labels — key=value tags applied by the platform team when the resource is registered. You can’t set them yourself; you read them to find what you need.

The four labels that matter for navigation at better.care:

Label What it means

teleport_access

The access tag, in the form <tenant>:<department>:<environment>. This is the single label that determines whether your role grants you the node. If you can’t reach a node, your role almost certainly does not include its teleport_access value.

tenant

The organisation or site the node belongs to. Acts as a tenant gate on leaf clusters.

department

The owning function or team.

environment

The lifecycle stage of the node (typically dev / uat / prod or similar).

For Azure-discovered nodes the same access label appears prefixed as azure/teleport_access — same meaning; both keys may be present on Azure VMs.
On databases and apps the same access tag uses dots instead of colons (tenant.department.environment) — same meaning, different separator.

2.3. Reading labels in tsh ls

tsh ls prints one node per line with its labels in the right-hand column:

Node Name        Address        Labels
---------------  -------------  -------------------------------------------------
node-a           ⟵ Tunnel       env=prod,tenant=<tenant>,department=<dept>,teleport_access=tenantA:dept1:prod
node-b           ⟵ Tunnel       env=uat,tenant=<tenant>,department=<dept>,teleport_access=tenantA:dept1:uat

You can filter by label with the comma-separated key=value syntax:

tsh ls env=prod,tenant=<your-tenant>
tsh ls teleport_access=<tenant>:<department>:<environment>
tsh ls teleport_access=tenantA:dept1:prod

For richer expressions use the predicate form (covered in [cheat-sheet]):

tsh ls --query='labels["env"] == "prod"'

3. The account you land on

Teleport does not give you a personal Linux account on each server. It logs you in as a shared service account, and it picks the account for you — you never choose it.

On better.care-managed servers that account is better:

tsh ssh better@<node>

On a leaf cluster — a customer-managed estate — the account is whatever that estate’s admins have predefined, which may not be better. The Web UI and Teleport Connect show the available login for each server, so you do not have to guess.

To avoid typing the account every time, set export TELEPORT_LOGIN=better in your shell profile. Without it a bare tsh ssh <node> falls back to your local macOS or Linux username, which will not exist on the target and the connection will be refused.

Sharing the account does not make your activity anonymous. Teleport authenticates you, and the audit log and session recordings are attributed to your own Teleport user — not to better. What you can do once connected is decided by the access you have been granted, not by the account name.

4. Daily use: tsh cheat-sheet

Command What it does

tsh login --proxy=teleport.better.care:443 --user=<u>

Acquire a fresh cert. Re-run when it expires.

tsh status

Show current profile, roles, and cert expiry.

tsh logout

Discard local certs.

tsh clusters

List the root cluster plus every leaf cluster you can reach. The Cluster Name column is what you pass to --cluster=…​ elsewhere.

tsh ls

List reachable SSH nodes in the current cluster, with labels. Filter: tsh ls env=prod,tier=web or tsh ls teleport_access=<tenant>:<department>:<environment>. Richer: tsh ls --query='labels["env"] == "prod"'.

tsh ls --cluster=<leaf-cluster>

Same listing, but against a leaf cluster. --cluster=…​ attaches to any tsh ls / tsh ssh / tsh scp call to target a leaf.

tsh ssh better@<node>

Open an SSH session. better is the shared service account used on better.care-managed servers — see The account you land on. On a leaf cluster it’s a predefined account set by that estate’s admins — e.g. tsh ssh <predefined-login>@<node> --cluster=<leaf-cluster>.

tsh kube ls

List Kubernetes clusters you can reach.

tsh kube login <cluster>

Add a kubeconfig context for that cluster. After this, plain kubectl works.

tsh kube login --all

Add (or refresh) a kubeconfig context for every cluster you can reach — run it after tsh login on a new laptop and whenever you are granted a new cluster. Details and the separate-file setup: Kubernetes.

tsh db ls

List databases you can reach.

tsh db connect --db-user=<your-username> <db>

Open a database shell (psql, mysql, …) through Teleport. For PostgreSQL/MySQL the --db-user is always your own Teleport username — your database account is created automatically per session. Details: Databases.

tsh proxy db --tunnel --db-user=<your-username> <db>

Authenticated local port for GUI clients (DataGrip, DBeaver, …) — no password. See Databases.

tsh apps ls

List web / TCP applications you can reach, with labels.

tsh apps login <app>

Log in to an app and (for web apps) print its public URL.

tsh proxy app <app>

Open an authenticated local listener for <app> on 127.0.0.1:<port>. Point curl, Bruno, or any TCP client at it. Also how Oracle and SQL Server are reached — see Databases and Web & TCP apps.

tsh recordings ls

List your recorded SSH / kube / db / app sessions.

tsh play <session-id>

Replay a recorded session.

5. Troubleshooting

  • "access denied" on tsh ssh / kubectl / tsh db connect — your cert probably expired. Check with tsh status; refresh with tsh login --proxy=teleport.better.care:443 --user=<username>.

  • access to db denied on a database connect — for PostgreSQL/MySQL, --db-user must be your own username; see Databases.

  • I lost my phone / OTP — contact the platform team; they can run the admin-side reset that lets you re-enrol.

  • JetBrains / VS Code can’t connect — confirm ~/.ssh/config has the Include ~/.ssh/teleport_config line and the file exists (re-run tsh config > ~/.ssh/teleport_config), confirm tsh status shows a valid cert, then run ssh -v <node>.<cluster-name> to see whether the ProxyCommand is being invoked. More in SSH, IDEs & port forwarding.

  • SSH session drops mid-work — your cert TTL elapsed. tsh login again.

  • tsh ls shows nothing — either no nodes are tagged with labels your role allows, or you’re pointed at the wrong cluster. Check tsh status and tsh clusters.

  • kubectl can’t see a cluster Teleport lists — the kubeconfig context hasn’t been generated yet. Run tsh kube login --all; see Kubernetes.

6. Getting help

For access requests, role changes, incidents — and for Oracle / SQL Server database accounts, which are provided by devops / the DB admins — reach out to the platform team via the same channel you’d normally use to request access.

For self-service answers on tsh flags and behaviour, the upstream docs are at https://goteleport.com/docs.