Authenticating Meshery via CLI

To authenticate Meshery through mesheryctl, the Meshery CLI, you will use the mesheryctl system login command. On executing this command, you will be provided with a list of providers to choose from. You can then select a Provider of your choice to complete the authentication and authorization process.

As of this writing, you will be presented with two providers, Layer5 and None.

Use the arrow keys to navigate: ↓ ↑ β†’ ← 
? Select a Provider: 
  β–Έ Layer5
    None
  • Selecting Layer5 will open a browser to complete the login and authentication process with Layer5 cloud. On successful authentication, you can close the window and return to the command prompt.

    Verify that an auth.json file was created in the .meshery folder in your home directory.

    ls -l $HOME/.meshery/
    
    total 12
    -rw-rw-r-- 1 ubuntu ubuntu  39 Dec 21 06:13 auth.json
    -rw-rw-r-- 1 ubuntu ubuntu 260 Dec 21 06:04 config.yaml
    -rw-rw-r-- 1 ubuntu ubuntu 988 Dec 21 06:04 meshery.yaml
    

    The need for authentication to Layer5 provider is to save your environment setup while also having persistent/steady sessions and to be able to retrieve performance test results.

  • Selecting None will create an empty auth.json file. All your work remains local and ephemeral.

If mesheryctl is running in a system that does not have a browser, you can download an auth token file from your Layer5 cloud account and copy it into the .meshery folder in your home directory. The following steps show how you can generate and download a token:

  1. Navigate to https://cloud.layer5.io/security/tokens and sign-in. Ensure you are in the right organization and click Create.

    Create Token

  2. Provide a token name and purpose. Click Create to generate.

    Generate Token

  3. Click the Download icon to download the auth.json file.

    Download Token

Then run mesheryctl system check to ensure you do not see an authentication error.

For an exhaustive list of mesheryctl commands and syntax, visit mesheryctl Command Reference.

Recent Discussions with "mesheryctl" Tag