From 12afc2dd189c906f686a1f0567f91c46ad6a09fb Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 13 Apr 2022 08:35:05 -0700 Subject: [PATCH] Change bash examples to code. Fixes copy/paste and more consistent --- docs/pages/api/architecture.mdx | 2 +- .../pages/database-access/getting-started.mdx | 2 +- .../guides/azure-postgres-mysql.mdx | 14 +++++----- .../guides/mysql-self-hosted.mdx | 2 +- .../guides/postgres-self-hosted.mdx | 2 +- .../database-access/guides/sql-server-ad.mdx | 26 +++++++++---------- docs/pages/enterprise/sso.mdx | 2 +- .../workflow/ssh-approval-pagerduty.mdx | 4 +-- .../sql-server-local-proxy.mdx | 4 +-- .../enterprise/oidcauthentication.mdx | 2 +- .../enterprise/samlauthentication.mdx | 2 +- .../getting-started/local.mdx | 2 +- .../kubernetes-access/helm/guides/custom.mdx | 2 +- .../helm/reference/teleport-kube-agent.mdx | 10 +++---- docs/pages/server-access/guides/ssh-pam.mdx | 2 +- .../pages/setup/deployments/aws-terraform.mdx | 2 +- docs/pages/setup/guides/ec2-tags.mdx | 2 +- docs/pages/setup/reference/cli.mdx | 8 +++--- 18 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/pages/api/architecture.mdx b/docs/pages/api/architecture.mdx index 2363531aac0d1..63fd3be31dc41 100644 --- a/docs/pages/api/architecture.mdx +++ b/docs/pages/api/architecture.mdx @@ -22,7 +22,7 @@ action on the `role` resource. You should create a user and role with the minimu (!docs/pages/includes/permission-warning.mdx!) -```bash +```code # Copy and Paste the below and run on the Teleport Auth server. cat > api-role.yaml < - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=teleport.example.com:3080 \ @@ -69,7 +69,7 @@ endpoint. - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=teleport.example.com:3080 \ @@ -92,7 +92,7 @@ endpoint. - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=mytenant.teleport.sh \ @@ -105,7 +105,7 @@ endpoint. - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=mytenant.teleport.sh \ @@ -197,7 +197,7 @@ achieve that: environment-based authentication with a client secret, the Database Service should have the following environment variables set: - ```bash + ```code export AZURE_TENANT_ID= export AZURE_CLIENT_ID= export AZURE_CLIENT_SECRET= @@ -229,14 +229,14 @@ fetch the access token and use it as a password when connecting to the database: - ```bash + ```code $ az login -u ad@example.com $ export PGPASSWORD=`az account get-access-token --resource-type oss-rdbms --output tsv --query accessToken` $ psql "host=example.postgres.database.azure.com user=ad@example.com@instance-name sslmode=require dbname=postgres" ``` - ```bash + ```code $ az login -u ad-admin@example.com $ export TOKEN=`az account get-access-token --resource-type oss-rdbms --output tsv --query accessToken` $ mysql -h example.mysql.database.azure.com -P 3306 -u ad@example.com@instance-name --enable-cleartext-plugin --password=$TOKEN diff --git a/docs/pages/database-access/guides/mysql-self-hosted.mdx b/docs/pages/database-access/guides/mysql-self-hosted.mdx index a18ccf12a8ce4..7f18799c20216 100644 --- a/docs/pages/database-access/guides/mysql-self-hosted.mdx +++ b/docs/pages/database-access/guides/mysql-self-hosted.mdx @@ -102,7 +102,7 @@ in the MariaDB documentation for more details. Create the role that will allow a user to connect to any database using any database account: -```bash +```code tctl --config=/path/to/teleport-db-role.yaml create < - ```bash + ```code $ sudo apt-get update $ sudo apt-get -y install sssd realmd krb5-user samba-common packagekit adcli ``` - ```bash + ```code $ sudo yum -y update $ sudo yum -y install sssd realmd krb5-workstation samba-common-tools ``` @@ -97,7 +97,7 @@ rdns = false Join the realm: -```bash +```code $ sudo realm join -v -U admin@EXAMPLE.COM example.com ... * Successfully enrolled machine in realm @@ -110,7 +110,7 @@ $ sudo realm join -v -U admin@EXAMPLE.COM example.com To confirm the node has joined the realm, use the `realm list` command: -```bash +```code $ sudo realm list example.com type: kerberos @@ -133,7 +133,7 @@ domain: - ```bash + ```code $ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - $ sudo curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list $ sudo apt-get update @@ -141,7 +141,7 @@ domain: ``` - ```bash + ```code $ sudo wget -qO /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc $ sudo curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list $ sudo apt-get update @@ -149,7 +149,7 @@ domain: ``` - ```bash + ```code $ sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repo $ sudo ACCEPT_EULA=Y yum install -y adutil ``` @@ -158,14 +158,14 @@ domain: Log in to Active Directory using the `kinit` command: -```bash +```code $ kinit admin@EXAMPLE.COM ``` Use the `adutil keytab create` command to generate keytab entries for each Active Directory user that will be connecting to the SQL Server database: -```bash +```code $ adutil keytab create teleport.keytab alice $ adutil keytab create teleport.keytab bob ``` @@ -194,7 +194,7 @@ be merged into the same `teleport.keytab` file. You can verify entries in the keytab file using `klist` command: -```bash +```code $ klist -ke teleport.keytab Keytab name: FILE:teleport.keytab KVNO Principal @@ -222,7 +222,7 @@ KVNO Principal Start the Teleport Database Service. Make sure to update `--auth-server` to point to your Teleport Proxy Service address and `--uri` to the SQL Server endpoint. - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=teleport.example.com:3080 \ @@ -242,7 +242,7 @@ Start the Teleport Database Service. Make sure to update `--auth-server` to point to your Teleport Cloud tenant address and `--uri` to the SQL Server endpoint. - ```bash + ```code $ teleport db start \ --token=/tmp/token \ --auth-server=mytenant.teleport.sh \ @@ -278,7 +278,7 @@ Server. Typically, they take a form of `MSSQLSvc/.:`. For example, an AWS RDS SQL Server named `sqlserver` and joined to an AWS managed Active Directory domain `EXAMPLE.COM` will have the following SPNs registered: -```bash +```code $ ldapsearch -x -h example.com -D admin -W -b DC=example,DC=com servicePrincipalName ... # EC2AMAZ-4KN05DU, RDS, AWS Reserved, example.com diff --git a/docs/pages/enterprise/sso.mdx b/docs/pages/enterprise/sso.mdx index 1955751cbe639..e28f7d17b9095 100644 --- a/docs/pages/enterprise/sso.mdx +++ b/docs/pages/enterprise/sso.mdx @@ -185,7 +185,7 @@ can define and create multiple connector resources using `tctl create` as shown To see all configured connectors, execute this on the auth server: -```bash +```code $ tctl get connectors ``` diff --git a/docs/pages/enterprise/workflow/ssh-approval-pagerduty.mdx b/docs/pages/enterprise/workflow/ssh-approval-pagerduty.mdx index 5a9aa8336fbca..6315d8471c601 100644 --- a/docs/pages/enterprise/workflow/ssh-approval-pagerduty.mdx +++ b/docs/pages/enterprise/workflow/ssh-approval-pagerduty.mdx @@ -52,7 +52,7 @@ location as plugins have a low memory footprint, and will require both public in and Teleport Auth access. We currently only provide linux-amd64 binaries, you can also compile these plugins from [source](https://github.com/gravitational/teleport-plugins/tree/master/access/pagerduty). -```bash +```code $ wget https://get.gravitational.com/teleport-access-pagerduty-v(=teleport.plugin.version=)-linux-amd64-bin.tar.gz $ tar -xzf teleport-access-pagerduty-v(=teleport.plugin.version=)-linux-amd64-bin.tar.gz $ cd teleport-access-pagerduty/ @@ -114,7 +114,7 @@ By default, `teleport-pagerduty` will assume its config is in `/etc/teleport-pag In production, we recommend starting the Teleport plugin daemon via an init system like systemd. Here's the recommended Teleport plugin service unit file for systemd: -```bash +```code (!examples/systemd/plugins/teleport-pagerduty.service!) ``` diff --git a/docs/pages/includes/database-access/sql-server-local-proxy.mdx b/docs/pages/includes/database-access/sql-server-local-proxy.mdx index bc07fbc083434..65d213c9eabc0 100644 --- a/docs/pages/includes/database-access/sql-server-local-proxy.mdx +++ b/docs/pages/includes/database-access/sql-server-local-proxy.mdx @@ -4,7 +4,7 @@ SQL Server clients connect to a Teleport cluster via the local proxy in Log into your SQL Server database with `tsh db login` and execute `tsh db config` to locate the paths to the client certificate and key pair: -```bash +```code $ tsh db config sqlserver Name: sqlserver ... @@ -15,7 +15,7 @@ Key: /home/alice/.tsh/keys/teleport.example.com/alice Start the local TLS proxy providing the cert/key paths and, optionally, the port number to listen on: -```bash +```code $ tsh proxy db \ --port 4242 \ --cert-file /home/alice/.tsh/keys/teleport.example.com/alice-db/cluster/example-x509.pem \ diff --git a/docs/pages/includes/enterprise/oidcauthentication.mdx b/docs/pages/includes/enterprise/oidcauthentication.mdx index fa848c89e222c..a609ee7c6d925 100644 --- a/docs/pages/includes/enterprise/oidcauthentication.mdx +++ b/docs/pages/includes/enterprise/oidcauthentication.mdx @@ -25,7 +25,7 @@ user database. You can use Dynamic Resources for Teleport Cloud as well as self- Create a resource: - ```bash + ```code $ tctl create -f cap.yaml ``` diff --git a/docs/pages/includes/enterprise/samlauthentication.mdx b/docs/pages/includes/enterprise/samlauthentication.mdx index eef0f8775e3ea..e553fb34baa93 100644 --- a/docs/pages/includes/enterprise/samlauthentication.mdx +++ b/docs/pages/includes/enterprise/samlauthentication.mdx @@ -26,7 +26,7 @@ user database. You can use Dynamic Resources for Teleport Cloud as well as self- Create a resource: - ```bash + ```code $ tctl create -f cap.yaml ``` diff --git a/docs/pages/kubernetes-access/getting-started/local.mdx b/docs/pages/kubernetes-access/getting-started/local.mdx index cb1199d42b3fb..684060ec2904b 100644 --- a/docs/pages/kubernetes-access/getting-started/local.mdx +++ b/docs/pages/kubernetes-access/getting-started/local.mdx @@ -152,7 +152,7 @@ If you are getting a "Connection refused" error, that probably means that the `s - Ensure that no configuration options or environment variables are conflicting with the `ssh` command, which will resemble the following: - ```bash + ```code $ sudo ssh -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ -N docker@127.0.0.1 \ diff --git a/docs/pages/kubernetes-access/helm/guides/custom.mdx b/docs/pages/kubernetes-access/helm/guides/custom.mdx index a5a126b170b85..549d4db708cc1 100644 --- a/docs/pages/kubernetes-access/helm/guides/custom.mdx +++ b/docs/pages/kubernetes-access/helm/guides/custom.mdx @@ -30,7 +30,7 @@ expects that you will provide this yourself. For this example, we'll be using this `teleport.yaml` configuration file with a static join token (for more information on join tokens, see [Adding Nodes to the Cluster](../../../setup/admin/adding-nodes.mdx)): -```bash +```code $ cat << EOF > teleport.yaml teleport: log: diff --git a/docs/pages/kubernetes-access/helm/reference/teleport-kube-agent.mdx b/docs/pages/kubernetes-access/helm/reference/teleport-kube-agent.mdx index 940bd230e56bb..4e90f4514a5d5 100644 --- a/docs/pages/kubernetes-access/helm/reference/teleport-kube-agent.mdx +++ b/docs/pages/kubernetes-access/helm/reference/teleport-kube-agent.mdx @@ -403,7 +403,7 @@ When `existingDataVolume` is set to the name of an existing volume, the `/var/li ``` - ```bash + ```code --set existingDataVolume=my-volume ``` @@ -496,7 +496,7 @@ Enables the creation of a Kubernetes persistent volume to hold Teleport agent st ``` - ```bash + ```code --set storage.enabled=true ``` @@ -521,7 +521,7 @@ name needs to exist on the Kubernetes cluster for Teleport to use. ``` - ```bash + ```code --set storage.storageClassName=teleport-storage-class ``` @@ -543,7 +543,7 @@ The size of persistent volume to create. ``` - ```bash + ```code --set storage.requests=128Mi ``` @@ -993,7 +993,7 @@ Kubernetes affinity to set for pod assignments. ``` - ```bash + ```code --set nodeSelector.role=node \ --set nodeSelector.region=us-east ``` diff --git a/docs/pages/server-access/guides/ssh-pam.mdx b/docs/pages/server-access/guides/ssh-pam.mdx index a6603170d2429..71d7d38160942 100644 --- a/docs/pages/server-access/guides/ssh-pam.mdx +++ b/docs/pages/server-access/guides/ssh-pam.mdx @@ -270,7 +270,7 @@ identity information. The `useradd` location can have a different path than the example below depending on your linux flavor. Adjust to your particular system as needed from `which useradd` (Ex: `/usr/sbin/useradd` instead of the below example). -```bash +```code mkdir -p /etc/pam-exec.d cat > /etc/pam-exec.d/teleport_acct <" diff --git a/docs/pages/setup/reference/cli.mdx b/docs/pages/setup/reference/cli.mdx index 6de2f677db3dc..e6a8c434e0deb 100644 --- a/docs/pages/setup/reference/cli.mdx +++ b/docs/pages/setup/reference/cli.mdx @@ -1360,13 +1360,13 @@ The `--query` flag allows you to perform more sophisticated searches using a [pr In both cases, you can further refine the results by appending a list of comma-separated labels to the command. For example: -```bash +```code $ tsh ls --search=foo,bar labelKey1=labelValue1,labelKey2=labelValue2 ``` ### Filter Examples -```bash +```code # List all nodes $ tsh ls @@ -1387,7 +1387,7 @@ $ tsh ls --query='labels.env == "staging" && equals(labels.os, "mac")' Displays user accesses to SSH nodes -```bash +```code tctl access ls [--user | --login | --node ][] ``` @@ -1402,7 +1402,7 @@ tctl access ls [--user | --login | --node ][] #### Examples -```bash +```code # Get all user accesses over all nodes tctl access ls # Get accesses for user 'joe'