SSH Access to a Host via Teleport
Use this guide to initiate an SSH session via Teleport using the tsh CLI. If
you prefer, you can alternatively open a session directly through the
web UI.
Prerequisites
Section titled “Prerequisites”- Teleport access via Okta. If you do not have this yet, follow the getting access guide first.
tshis installed. See installation instructions.
Process
Section titled “Process”Request access
Section titled “Request access”- Log in to Teleport:
tsh login --proxy=production.teleport.gitlab.net- Identify the name of the node:
The name of the Teleport node must be provided in order to log in. This is usually equal to the hostname, but in some cases it may be the fully-qualified domain name.
tsh ls --search redis # search by node nametsh ls # all hoststsh ls env=gstg # filter by environmenttsh ls env=gprd- Request access to the resource:
tsh request create \ --resource=<node name> \ --reason="<GitLab issue URL / ZenDesk ticket URL>"-
Ask an Engineering or Security manager to review the request. You may direct them to the Teleport Approver Workflow in case they are unfamiliar with the process.
-
Once approved, log in with
tshusing the request ID to assume the role:
tsh login --request-id=<request-id>Log in
Section titled “Log in”- Connect to the host:
tsh ssh <username>@<hostname>Next Steps
Section titled “Next Steps”- Access expires after 12 hours. Renew it before or after expiration using the same request process.
- Learn about tsh’s features in Teleport’s docs.
Support
Section titled “Support”- For help with Teleport or the approval process, ask in #security_help.
- To report a Teleport bug, open an issue with Infrastructure Security.
Troubleshooting
Section titled “Troubleshooting”tsh request create timed out
Section titled “tsh request create timed out”tsh request create will wait for approval and return once the request is
approved, denied, or expires.
If it times out before a decision, check #teleport-requests slack channel or the Teleport Web UI for the request ID — you don’t need to re-request if it was approved.
failed to add one or more keys to the agent
Section titled “failed to add one or more keys to the agent”See getting_access.md — Troubleshooting.
Verbose output
Section titled “Verbose output”tsh --debug ssh <user>@<hostname>