--- title: Teleport CLI Reference description: Detailed guide and reference documentation for Teleport's command line interface (CLI) tools. --- Teleport is made up of four CLI tools. - [teleport](#teleport): Supports the Teleport access plane by starting and configuring various Teleport services. - [tsh](#tsh): Allows end users to authenticate to Teleport and access resources in a cluster. - [tctl](#tctl): Used to configure the Teleport Auth Service. - [tbot](#tbot): Supports Machine ID, which provides short lived credentials to service accounts (e.g, a CI/CD server). (!docs/pages/includes/permission-warning.mdx!) (!docs/pages/includes/backup-warning.mdx!) ## teleport The CLI tool that supports the Teleport access plane is called `teleport`, and allows Teleport services to be managed over the command line: - [Auth](../architecture/authentication.mdx) - [Node/SSH](../architecture/nodes.mdx) - [Proxy](../architecture/proxy.mdx) - [App](../application-access/introduction.mdx) - [Database](../database-access/introduction.mdx) - [Windows Desktop](../desktop-access/introduction.mdx) - [Kubernetes](../kubernetes-access/introduction.mdx) The primary commands for the `teleport` CLI are as follows: | Command | Description | | - | - | | `teleport help` | Outputs guidance for using Teleport commands. | | `teleport start` | Starts the `teleport` process in the foregound using the current shell session, including any services configured by the [configuration YAML file](config.mdx). | | `teleport status` | Prints the status of the current active Teleport SSH session. | | `teleport configure` | Generates and writes a [configuration YAML file](config.mdx) for the Teleport service. This file should be customized in production to suit the needs of your environment, and the default output should only be used when testing. | | `teleport version` | Prints the current release version of the Teleport binary installed on your system. | | `teleport app start` | Starts the Teleport Application Service. | | `teleport db start` | Starts the Teleport Database Service. | | `teleport db configure create` | Generates a configuration YAML file for the Database Service. This file should be customized in production to suit the needs of your environment, and the default output should only be used when testing. | | `teleport db configure bootstrap` | Used to bootstrap a configuration to the Teleport Database Service by reading a provided configuration. | | `teleport db configure aws print-iam` | Generates and outputs current IAM policies for a Teleport-managed database. | | `teleport db configure aws create-iam` | Generates, creates, and attaches desired IAM policies to a Teleport-managed database. | | `teleport install systemd` | Creates a systemd unit file, used to configure and install a `teleport` service daemon. | | `teleport node configure` | Generates a configuration YAML file for a Teleport Node accessed via SSH. This file should be customized in production to suit the needs of your environment, and the default output should only be used when testing. | For more information on subcommands when working with the `teleport` cli, use the `--help` option or `teleport --help`. ### teleport start The `teleport start` command includes a large number of optional configuration flags. While configuration flags for `teleport start` can be used to set parameters for Teleport's configuration, we recommend using a [configuration file](https://goteleport.com/docs/reference/config/) in production. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `-d, --debug` | none | none | enable verbose logging to stderr | | `--insecure-no-tls` | `false` | `true` or `false` | Tells proxy to not generate default self-signed TLS certificates. This is useful when running Teleport on kubernetes (behind reverse proxy) or behind things like AWS ELBs, GCP LBs or Azure Load Balancers where SSL termination is provided externally. | | `-r, --roles` | `proxy`, `node`, `auth` | **string** comma-separated list of `proxy`, `node`, `auth`, `db`, or `app` | start listed services/roles. These roles are explained in the [Core Concepts](../core-concepts.mdx) document. | | `--pid-file` | none | **string** filepath | create a PID file at the path | | `--advertise-ip` | none | **string** IP | advertise IP to clients, often used behind NAT | | `-l, --listen-ip` | `0.0.0.0` | [**net. IP**](https://golang.org/pkg/net/#IP) | binds services to IP | | `--auth-server` | none | **string** IP | proxy attempts to connect to a specified auth server instead of local auth, disables `--roles=auth` if set | | `--token` | none | **string** | set invitation token to register with an auth server on start, used once and ignored afterwards. Obtain it by running `tctl nodes add` on the auth server.*We recommend to use tools like `pwgen` to generate sufficiently random tokens of 32+ byte length.* | | `--ca-pin` | none | **string** `sha256:` | set CA pin to validate the Auth Server. Generated by `tctl status` | | `--nodename` | value returned by the `hostname` command on the machine | **string** | assigns an alternative name for the node which can be used by clients to log in. | | `-c, --config` | `/etc/teleport.yaml` | **string** `.yaml` filepath | starts services with config specified in the YAML file, overrides CLI flags if set | | `--apply-on-startup` | none | **string** `.yaml` filepath | On startup, always apply resources described in the file at the given path. Only supports the following types: `token`. | | `--bootstrap` | none | **string** `.yaml` filepath | bootstrap configured YAML resources {/* TODO link how to configure this file */} | | `--labels` | none | **string** comma-separated list | assigns a set of labels to a node, for example env=dev,app=web. See the explanation of labeling mechanism in the [Labeling Nodes](../management/admin/labels.mdx) section. | | `--insecure` | none | none | disable certificate validation on Proxy Service, validation still occurs on Auth Service. | | `--fips` | none | none | start Teleport in FedRAMP/FIPS 140-2 mode. | | `--skip-version-check` | `false` | `true` or `false` | Skips version checks between the Auth Server this Teleport instance | | `--diag-addr` | none | none | Enable diagnostic endpoints | | `--permit-user-env` | none | none | flag reads in environment variables from `~/.tsh/environment` when creating a session. | | `--app-name` | none | none | Name of the application to start | | `--app-uri` | none | none | Internal address of the application to proxy | | `--app-public-addr` | none | none | Public address fo the application to proxy | #### teleport start --roles The `--roles` flag when used with `teleport --start` instructs Teleport on which specific Teleport services to start. Below is a more cohesive table of roles and their associated services that `teleport start` supports: | Service | Role Name | Description | | - | - | - | | [Node](../architecture/nodes.mdx) | `node` | Allows SSH connections from authenticated clients. | | [Auth](../architecture/authentication.mdx) | `auth` | Authenticates and authorizes hosts and users who want access to Teleport-managed resources or information about a cluster. | | [Proxy](../architecture/proxy.mdx) | `proxy` | The gateway that clients use to connect to the Auth Service or resources managed by Teleport. | | [App](../application-access/introduction.mdx) | `app` | Provides access to applications. | | [Database](../database-access/reference.mdx) | `db` | Provides access to databases. | Teleport Cloud manages Teleport instances with the `auth` and `proxy` roles. Use the remaining roles to manage access to specific resources and other Teleport clusters. #### Examples ``` # By default without any configuration, teleport starts running as a single-node # cluster. It's the equivalent of running with --roles=node,proxy,auth sudo teleport start # Starts a node named 'db' running in strictly SSH mode role, joining the cluster # serviced by the auth server running on 10.1.0.1 sudo teleport start --roles=node --auth-server=10.1.0.1 --token=xyz --nodename=db # Same as the above, but the node runs with db=master label and can be connected # to using that label in addition to its name. sudo teleport start --roles=node --auth-server=10.1.0.1 --labels=db=master # Starts an app server that proxies the application "example-app" running at http://localhost:8080. sudo teleport start --roles=app --token=xyz --auth-server=proxy.example.com:3080 \ --app-name="example-app" \ --app-uri="http://localhost:8080" \ --labels=group=dev ``` ## tsh `tsh` is a CLI client used by Teleport Users. It allows users to interact with current and past sessions on the cluster, copy files to and from nodes, and list information about the cluster. ### tsh global flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `-l, --login` | none | an identity name | The login identity that the Teleport user will use | | `--proxy` | none | `host:https_port[,ssh_proxy_port]` | Teleport Proxy Service address | | `--user` | `$USER` | none | The Teleport username | | `--ttl` | `720` (12 hours) | integer | Number of minutes a certificate issued for the `tsh` user will be valid for | | `-i, --identity` | none | **string** filepath | Identity file | | `--cert-format` | `standard` | `standard` or `oldssh` | SSH certificate format | | `--insecure` | none | none | Do not verify the server's certificate and host name. Use only in test environments. | | `--auth` | `local` | any defined [authentication connector](./authentication.mdx), including `local` and `passwordless` | Specify the type of authentication connector to use. | | `--mfa-mode` | auto | `auto`, `cross-platform`, `platform` or `otp` | Preferred mode for MFA and Passwordless assertions. | | `--skip-version-check` | none | none | Skip version checking between server and client. | | `-d, --debug` | none | none | Verbose logging to stdout | | `-J, --jumphost` | none | A jump host | SSH jumphost | ### tsh help Prints help: ```code $ tsh help ``` ### tsh version Prints the version of your `tsh` binary and the Teleport Proxy Service in the current `tsh` profile ```code $ tsh version [] ``` | Name | Default Value(s) | Allowed Value(s) | Description | |----------------|------------------|------------------|----------------------------------------------------| | `-f, --format` | `text` | text, json, yaml | Format for version output | | `--client` | none | none | Show the client version only (no server required). | #### Examples ```code $ tsh version Teleport v(=teleport.version=) git: go(=teleport.golang=) Proxy version: (=teleport.version=) Proxy: teleport.example.com:443 ``` Display in JSON format: ```code $ tsh version --format=json ``` ```json { "version": "(=teleport.version=)", "gitref": "", "runtime": "go(=teleport.golang=)", "proxyVersion": "(=teleport.version=)", "proxyPublicAddress": "teleport.example.com:443" } ``` Only display the `tsh` binary version: ```code $ tsh version --client Teleport v(=teleport.version=) git: go(=teleport.golang=) ``` ### tsh ssh Run shell or execute a command on a remote SSH node: ```code $ tsh ssh [] <[user@]host> [...] ``` #### Arguments `<[user@]host> [...]` - `user` The login identity to use on the remote host. If `[user]` is not specified the user defaults to `$USER` or can be set with `--user`. If the flag `--user` and positional argument `[user]` are specified the arg `[user]` takes precedence. - `host` The `nodename` of a cluster Node or a label specification like `env=aws` to run on all matching hosts. - `command` The command to execute on a remote host. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `-p, --port` | none | port | SSH port on a remote host | | `-A, --forward-agent` | none | none | Forward agent to target node like `ssh -A` | | `-L, --forward` | none | none | Forward localhost connections to remote server | | `-D, --dynamic-forward` | none | none | Forward localhost connections to remote server using SOCKS5 | | `-N, -no-remote-exec` | none | none | Don't execute remote command, useful for port forwarding | | `--local` | none | | Execute command on localhost after connecting to SSH node | | `-t, --tty` | `file` | | Allocate TTY | | `--cluster` | none | | Specify the cluster to connect | | `-o, --option` | `local` | | OpenSSH options in the format used in the configuration file | | `--enable-escape-sequences` | | | Enable support for SSH escape sequences. Type `~?` during an SSH session to list supported sequences. | | `--no-use-local-ssh-agent` | | | Do not load generated SSH certificates into the local ssh-agent (specified via `$SSH_AUTH_SOCK`). Useful when using `gpg-agent` or Yubikeys. You can also set the `TELEPORT_USE_LOCAL_SSH_AGENT` environment variable to `false` (default `true`) | | `-X, --x11-untrusted` | none | none | Requests untrusted (secure) X11 forwarding for this session. | | `-Y, --x11-trusted` | none | none | Requests trusted (insecure) X11 forwarding for this session. This can make your local machine vulnerable to attacks, use with caution. | | `--x11-untrusted-timeout` | 10m | duration | Sets a timeout for untrusted X11 forwarding, after which the client will reject any forwarding requests from the server. | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code # Log in to node `grav-00` as OS User `root` with Teleport User `teleport` $ tsh ssh --proxy proxy.example.com --user teleport -d root@grav-00 # `tsh ssh` takes the same arguments as OpenSSH client: $ tsh ssh -o ForwardAgent=yes root@grav-00 $ tsh ssh -o AddKeysToAgent=yes root@grav-00 # Run `hostname` on all nodes with the `env: aws` label $ tsh ssh root@env=aws hostname ``` ### tsh config Generates OpenSSH configuration to use currently logged in teleport as a bastion host. ```code $ tsh config ``` #### Examples ```code # Print OpenSSH config file to console $ tsh config # Append Teleport configuration to ssh config $ tsh config >> ~/.ssh/config ``` ### tsh apps ls List all available applications: ```code $ tsh apps ls ``` ### tsh gcloud Proxy `gcloud` CLI commands through the Teleport Application Service. `gcloud` is a tool for interacting with Google Cloud. A user must already be authenticated to a Google Cloud application in Teleport before they can execute `tsh gcloud` commands. ```code $ tsh gcloud [--app] [] ``` #### Arguments `command`: A `gcloud` command to run, including arguments and flags. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--app` | Currently logged in Google Cloud application | The name of a Google Cloud application as listed via `tsh apps ls`. | The Google Cloud application to run the command against, if logged in to multiple Google Cloud applications. | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code $ tsh gcloud compute instances list ``` ### tsh gsutil Proxy `gsutil` CLI commands through the Teleport Application Service. `gsutil` is a tool for interacting with Google Cloud Storage. A user must already be authenticated to a Google Cloud application in Teleport before they can execute `tsh gsutil` commands. ```code $ tsh gsutil [--app] [] ``` #### Arguments `command`: A `gsutil` command to run, including arguments and flags. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--app` | Currently logged in Google Cloud application | The name of a Google Cloud application as listed via `tsh apps ls`. | The Google Cloud application to run the command against, if logged in to multiple Google Cloud applications. | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code $ tsh gsutil ls ``` ### tsh join Joins an active session: ```code $ tsh join [] ``` #### Arguments `` - `session-id` The UUID of an active Teleport Session obtained by `teleport status` within the session. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--cluster` | none | a cluster_name | Specify the cluster to connect | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code # join session using teleport user joe as ec2-user $ tsh --user=joe --login=ec2-user join ``` ### tsh recordings ls List recorded sessions. ```code $ tsh recordings ls [] ``` #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--from-utc` | 24 hours ago | date | Start of time range in which recordings are listed. Format 2006-01-02. Defaults to 24 hours ago. | | `--to-utc` | current | date | Start of time range in which recordings are listed. Format 2006-01-02. Defaults to 24 hours ago. | | `--limit` | 50 | number | Maximum number of recordings to show. | | `--last` | none | duration | Duration into the past from which session recordings should be listed. Format 5h30m40s | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code # get the recorded sessions from the last 24 hours $ tsh --proxy proxy.example.com recordings ls ID Type Participants Hostname Timestamp ------------------------------------ ---- ------------ -------- ------------------- b0a04442-70dc-4be8-9308-7b7901d2d600 ssh jeff dev Nov 26 16:36:16 UTC c0a02222-70dc-4be8-9308-7b7901d2d600 kube alice Nov 26 20:36:16 UTC d0a04442-70dc-4be8-9308-7b7901d2d600 ssh navin test Nov 26 16:36:16 UTC # The session can be played with tsh play $ tsh play c0a02222-70dc-4be8-9308-7b7901d2d60 # List recorded sessions that occurred between Nov 1, 2022 to Nov 3, 2022 $ tsh recordings ls --from-utc=2022-11-01 --to-utc=2022-11-3 # Retrieve recorded sessions in the last 6 hours $ tsh recordings ls --last=6h0m0s ``` Recorded sessions are linked from the audit events to session recordings files in their [storage backend](../reference/backends.mdx). The following error can occur if a session recording file is not available or when employing multiple auth servers with directory storage backend for recorded sessions. When using a directory storage backend for audit logs and recorded sessions, only the auth server with that recorded session can retrieve it. ```code $ tsh play c8e1b2c5-322a-4095-89e3-391edfd2da9b ERROR: Recording for session c8e1b2c5-322a-4095-89e3-391edfd2da9b not found. ``` Using a Security Information and Event Management (SIEM) service that combines the audit logs will help consolidate the list of available recordings. Downloaded recorded session are directly playable as a file. ```code $ tsh play c8e1b2c5-322a-4095-89e3-391edfd2da9b.tar ``` ### tsh play Plays back a prior session: ```code $ tsh play [] ``` #### Arguments `` - `session-id` The UUID of a past Teleport Session obtained by `teleport status` within the session or from the Web UI. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--cluster` | none | a cluster_name | Specify the cluster to connect | | `--format` | `pty` | json, pty | Format for playback | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code $ tsh --proxy proxy.example.com play # Playing back a session using pty format using a downloaded session recording. $ tsh play --format=pty 1fe153d1-ce8b-4ef4-9908-6539457ba4ad.tar # Playing back a session in json format using jq to filter on events $ tsh play --format=json ~/play/0c0b81ed-91a9-4a2a-8d7c-7495891a6ca0.tar | jq '.event ``` ### tsh proxy db Start a local TLS proxy for database connections when using Teleport with TLS Routing enabled. Clients can connect to a Teleport-registered database through the local proxy. ```code $ tsh proxy db [] ``` #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--cert-file` | none | string | Path to the certificate file for configuring TLS on the local proxy.| | `--cluster` | none | string | The name of the Teleport cluster to connect to. | | `--key-file` | none | string | Path to the private key file for configuring TLS on the local proxy.| | `--db-name` | none | string | Optional database name to log in to. | | `--db-user` | none | string | Optional database user to log in as. | | `--port` | none | string | Source port used by the local proxy.| | `--tunnel` | none | Boolean | Open an authenticated tunnel using a database's client certificate so clients don't need to authenticate. | #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) #### Examples Proxy a DB connection to a named database ```code $ tsh proxy db ``` Proxy a connection to mysql db on local port 10700: ```code $ tsh proxy db --port 10700 mysql-db # Started DB proxy on 127.0.0.1:10700 # Use following credentials to connect to the mysql-db proxy: # ca_file=/Users/jeff/.tsh/keys/teleport.example.com/cas/teleport.example.com.pem # cert_file=/Users/jeff/.tsh/keys/teleport.example.com/jeff-db/tele1c/mysql-db-x509.pem # key_file=/Users/jeff/.tsh/keys/teleport.example.com/jeff ``` Proxy a connection to mysql db with no credentials required: ```code $ tsh proxy db --tunnel mysql-db Started authenticated tunnel for the MySQL database "mysql-db" in cluster "teleport.example.com" on 127.0.0.1:49415. Use the following command to connect to the database: $ mysql --port 49415 --host localhost --protocol TCP ``` ### tsh proxy ssh Start a local TLS proxy for `ssh` connections when using Teleport in TLS Routing mode. This is typically used as part of the SSH client configuration to use `ssh` as a client through Teleport. See the [OpenSSH Guide](../server-access/guides/openssh.mdx) guide on configuring OpenSSH servers and clients. The `tsh config` output will include `tsh proxy ssh` within a `ProxyCommand` directive. ```code $ tsh proxy ssh [] <[user@]host> ``` #### Arguments - `<[user@]host>` Remote hostname and the login to use #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--cluster` | none | Teleport Cluster | The name of the Teleport cluster to connect to.| #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) #### Examples Run the following command to generate an OpenSSH client configuration: ```code $ tsh config ``` This command produces the following configuration: ``` # Common flags for all example.com hosts Host *.example.com example.com UserKnownHostsFile "/Users/jeff/.tsh/known_hosts" IdentityFile "/Users/jeff/.tsh/keys/enterprise.teleportdemo.com/jeff" CertificateFile "/Users/jeff/.tsh/keys/example.com/jeff-ssh/example.com-cert.pub" PubkeyAcceptedKeyTypes +ssh-rsa-cert-v01@openssh.com HostKeyAlgorithms ssh-rsa-cert-v01@openssh.com # Flags for all example.com hosts except the proxy Host *.example.com !example.com Port 3022 ProxyCommand "/usr/local/bin/tsh" proxy ssh --cluster=example.com --proxy=example.com %r@%h:%p ``` This output should be placed into the default SSH Config for environment, `~/.ssh/config` for Mac/Linux or `.ssh\config` in the Windows User home directory. You can use this as a standalone SSH config file too. When you run an `ssh` command against a host with a subdomain of your Proxy Service's domain, this SSH configuration will use the `ProxyCommand` to run `tsh proxy ssh`: ```code $ ssh myuser@node1.example.com ``` ### tsh proxy app Starts a local TLS proxy for Application Access connections. You can use this proxy to connect to an application repeatedly after a single login to your Teleport cluster, which is especially useful for interacting with an application via a CLI. ```code $ tsh proxy app [] ``` #### Arguments `` - `app` The name of the application to start the local proxy for. To see a list of available applications, run `tsh apps ls`. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `-p, --port` | none | port number | Specify the source port for the local proxy | #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) #### Examples ```code $ tsh proxy app # Proxy a connection to grafana on local port 10700 $ tsh proxy --port 10700 app grafana & # Proxying connections to grafana on 127.0.0.1:10700 $ curl http://127.0.0.1:10700/api/users ``` ### tsh proxy azure Starts a local proxy server that provides secure access to an Azure managed service identity endpoint. This is useful for managing access to Azure from custom client applications. The local proxy forwards traffic to the Teleport Application Service, which uses an Azure managed identity to fetch an authentication token from Azure. ```code $ tsh proxy azure [] ``` The command will print the address of the local proxy server along with `export` commands for environment variables required to connect: ```text Started Azure proxy on http://127.0.0.1:54330. To avoid port randomization, you can choose the listening port using the --port flag. Use the following credentials and HTTPS proxy setting to connect to the proxy: export AZURE_CONFIG_DIR=/Users/myuser/.tsh/azure/my.teleport.cluster/azure export HTTPS_PROXY=http://127.0.0.1:54330 export HTTP_PROXY=http://127.0.0.1:54330 export MSI_ENDPOINT=https://azure-msi.teleport.dev/eedfd5b55257c0aaa58f export REQUESTS_CA_BUNDLE=/Users/myuser/.tsh/keys/teleport.example.com/myuser-app/teleport.example.com/azure-cli-localca.pem ``` `tsh proxy azure` runs the local proxy in the foreground, so don't interrupt the process or exit the terminal where you ran the command until you're ready to close the local proxy. Copy the `export` commands and paste them into a second terminal. To run the local proxy server, one of the user's roles must include the `spec.allow.azure_identities` field with one of the identities used by the Application Service. To learn how to set up secure access to Azure via Teleport, read [Protect the Azure CLI with Teleport Application Access](../application-access/cloud-apis/azure.mdx). #### Arguments This command does not accept any arguments. #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--app` | none | string | Name of the Teleport application representing Azure (i.e., based on `tsh apps ls`). Use this flag if your Teleport user has access to multiple Azure applications. | | `--port` | none | port number | The port on `localhost` where the local proxy will listen for connections. | | `--format` | `powershell` if on Windows, `unix` otherwise | `text`, `unix`, `command-prompt`, or `powershell` | The format to use for listing environment variables for Azure client applications connecting to the local proxy. | #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) ### tsh proxy aws Start a local proxy for AWS access. The user must already be logged in to at least one AWS application via Teleport before the proxy can start. ```code $ tsh proxy aws [] ``` #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--app` | Currently logged in AWS app | string | Optional name of the AWS application (as shown in `tsh apps ls`) to use if logged in to multiple | | `-p, --port` | none | port number | Specify the source port for the local proxy | | ` -e, --endpoint-url` | HTTP Proxy | Endpoint URL | Run the local proxy to serve as an AWS endpoint URL. If not specified, the local proxy serves as an HTTPS proxy. | | `-f, --format` | unix | `text`, `unix`, `command-prompt`, or `powershell` | Optional format for printing environment variables for the AWS proxy | #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) #### Examples ```code # Proxy a connection to AWS with the default settings $ tsh apps login awsapp $ tsh proxy aws # Set env variables from output $ aws s3 ls # Proxying connections to AWS on 127.0.0.1:10700 to app awsapp2 $ tsh apps logins awsapp2 $ tsh proxy aws --port=10700 --app=awsapp2 # Set env variables from output $ aws s3 ls ``` ### tsh proxy gcloud Start a local proxy for Google Cloud API access. The user must already be logged in to at least one Google Cloud application via Teleport before the proxy can start. ```code $ tsh proxy gcloud [] ``` #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--app` | Currently logged in Google Cloud app | string | Optional name of the Google Cloud application (as shown in `tsh apps ls`) to use if logged in to multiple | | `-p, --port` | none | port number | Specify the source port for the local proxy | | `-e, --endpoint-url` | HTTP Proxy | Endpoint URL | Run the local proxy to serve as a Google Cloud endpoint URL. If not specified, the local proxy serves as an HTTPS proxy. | | `-f, --format` | unix | `text`, `unix`, `command-prompt`, or `powershell` | Optional format for printing environment variables for the Google Cloud proxy | #### [Global Flags](#tsh-global-flags) These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version-check, --debug, --jumphost, --format`. Run `tsh help ` or see the [Global Flags Section](#tsh-global-flags) #### Examples ```code $ tsh apps login google-cloud-app $ tsh proxy gcloud # Set env variables from output $ gcloud compute instances list $ gsutil ls ``` ### tsh scp Copies files from source to dest: ```code $ tsh scp [] ... ``` {/* TODO Confirm which flags are supported and whether supports multiple sources */} #### Arguments - `` - filepath to copy - `` - target destination #### Flags | Name | Default Value(s) | Allowed Value(s) | Description | | - | - | - | - | | `--cluster` | none | a cluster_name | Specify the cluster to connect | | `-r, --recursive` | none | none | Recursive copy of subdirectories | | `-P, --port` | none | port number | Port to connect to on the remote host | | `-q, --quiet` | none | none | Quiet mode | #### Global flags These flags are available for all commands `--login, --proxy, --user, --ttl, --identity, --cert-format, --insecure, --auth, --skip-version, --debug, --jumphost`. Run `tsh help ` or see the [Global Flags section](#tsh-global-flags). #### Examples ```code $ tsh --proxy=proxy.example.com scp example.txt user@host:/destination/dir ``` ### tsh ls List cluster nodes: ```code $ tsh ls [] [