How-To: Login with EZSSH
Overview - How to Sign In to the EZSSH Client
Before the EZSSH client can request SSH certificates for you, it needs to know who you are. EZSSH supports four authentication methods, so it works on your workstation, on a server you are connected to over SSH, and in your automation. Choose the one that matches your environment:
| Authentication Method | Best For | Command |
|---|---|---|
| Interactive browser login | People working on their own workstation | ezssh login |
| Device code | SSH sessions and machines without a browser | ezssh login --use-device-code |
| Managed identity | Workloads running on Azure resources | ezssh login --identity |
| Service principal | CI/CD pipelines and other automation | ezssh login --service-principal |
Prerequisites for Signing In With EZSSH
- You have downloaded and installed the EZSSH client.
- The Keytos application is registered in your Entra ID tenant.
How to Sign In With Interactive Browser Login
The default login method opens your browser and authenticates you with your Entra ID account. We recommend this method for people working on a workstation.
ezssh login
EZSSH opens a browser window where you sign in with your Entra ID credentials. Once you are authenticated, your session is cached and you do not need to sign in again until the session expires.
How to Sign In With a Device Code
Use this method to authenticate with the Entra ID device code flow. Instead of opening a browser on this machine, EZSSH gives you a code that you enter at login.microsoft.com/device on another device. Use it over SSH or on headless machines that have no browser.
ezssh login --use-device-code
--use-device-code cannot be combined with --identity or --service-principal.
How to Sign In With an Azure Managed Identity
Use this method when EZSSH runs on an Azure resource (such as a VM, a container, or an Azure DevOps agent) that has a managed identity assigned to it. No credentials are needed, because Azure provides the token automatically.
ezssh login --identity
Managed identity authentication only works when EZSSH is running on an Azure resource with a system-assigned or user-assigned managed identity. It does not work on a local workstation.
How to Sign In With a Service Principal
Use this method for automated pipelines, CI/CD systems, or any other non-interactive workload where you have a service principal registered in Entra ID. We recommend authenticating with a certificate instead of a client secret where you can, since a certificate’s private key is harder to leak than a secret that gets pasted into a pipeline variable.
How to Authenticate With a Certificate
Provide the path to the PEM certificate file of your service principal:
ezssh login --service-principal \
--username <CLIENT_ID> \
--certificate /path/to/cert.pem \
--tenant <TENANT_ID>
| Parameter | Description |
|---|---|
--username |
The Application (client) ID of your service principal. |
--certificate |
The path to the PEM certificate file associated with your service principal. |
--tenant |
The ID of the Entra ID tenant where the service principal is registered. |
How to Authenticate With a Client Secret
ezssh login --service-principal \
--username <CLIENT_ID> \
--password <CLIENT_SECRET> \
--tenant <TENANT_ID>
| Parameter | Description |
|---|---|
--username |
The Application (client) ID of your service principal. |
--password |
The client secret of your service principal. |
--tenant |
The ID of the Entra ID tenant where the service principal is registered. |
How to Sign Out of EZSSH
To sign out of all cached accounts, run:
ezssh logout
To sign out of a specific account only, pass the username with the -u flag:
ezssh logout -u <USERNAME>
Next Steps - How to Connect to Your SSH Endpoints
Now that you are signed in, you can start connecting to your SSH endpoints:
🚀 SSH to an Endpoint