How to Connect to Multiple Endpoints at Once

Prerequisites

  1. Download EZSSH
  2. Have at least one policy with endpoints

Tenant Prerequisites

The following prerequisites have to be done only once per tenant.

  1. Registering the application in your tenant
  2. Selecting a Plan

Getting the CSV

The easiest way to get a CSV of your endpoints is using EZSSH Interactive Mode.

  1. First run the following command in your favorite terminal:
ezssh i
  1. This command will start ezssh in interactive mode. EZSSH Interactive
  2. The fastest option is to press 4 and save all your available endpoints to a CSV. EZSSH Interactive
  3. If you only want the endpoints of a specific policy, press 0 to list your policies. EZSSH Interactive
  4. Select the policy you want to save.
  5. Select the “Download policy endpoints” EZSSH Interactive
  6. Once you have created the file with either of the two options exit interactive mode by going back to the main menu and selecting the exit option. Or by pressing CTRL + C

Editing the CSV

  1. The Create CSV command showed the location where the CSV was saved. Open that CSV. EZSSH Interactive
  2. The CSV will have 7 columns
    1. UserName: The Linux User Principal that will be used to login to the endpoint.
    2. Endpoint: The IP address or FQDN of the endpoint you will connect to.
    3. CertificateLength: The length of the certificate (how long will you have access to the endpoint). Defaults to the max allowed.
    4. PolicyID: Can be ignored, just makes it easier for EZSSH to process the request.
    5. PolicyType: Tells you if this is an Azure Policy or a Hybrid Policy.
    6. PortNumber: The port that EZSSH will attempt to connect to on the endpoint to start the SSH Session. Defaults to 22.
    7. JIT If you use Azure Networking JIT EZSSH can make the request to open it for you. Accepted values “TRUE” and “FALSE”. Defaults to FALSE
  3. Edit the CSV to the correct values and delete any rows of endpoints you do not want to connect to.
  4. Save the file changes.

Connecting to the CSV Endpoints

  1. Once the CSV has the values you want to use, run the following command.
ezssh batchssh -f <file path>
  1. EZSSH will get the needed certificates and open each SSH session in its own window.

Extra features

  1. If you want to send a command to all the servers in the CSV, add a -c and the command. For example:
ezssh batchssh -f "C:\Users\marco\AppData\Roaming\ezssh\AllEndpoints.csv" -c "echo EZSSH Rocks!"