Log In to Mondoo Platform With Your Browser
Log in to Mondoo Platform from cnspec as yourself, with your browser or a one-time code, to scan from your own machine without a registration token.
cnspec login without a token logs you in to Mondoo Platform as yourself. You approve the login in your browser, and cnspec can then scan and report results for a limited time. You don't need a registration token, and nothing is registered permanently.
Use it to scan from your own workstation. For a server, a service, or a pipeline that scans on its own, register cnspec instead.
Choose how to connect cnspec
| Log in with your browser | Register with a token | |
|---|---|---|
| Command | cnspec login | cnspec login --token "TOKEN" |
| Who cnspec is | You. Results are reported under your user. | A service account created for this machine. |
| What you need first | A Mondoo account with access to a space. | A registration token or a credentials file. |
| How long it lasts | 8 hours. Log in again after that. | Until you log out or the service account is removed. |
| What it can do | Scan, and report the results to the space you choose. | Scan, report, and run as a service. |
| Needs a terminal | Yes. Someone has to approve the login. | No. |
Log in
-
In a terminal, run:
cnspec loginIf your organization is not in the US region, name your region's API endpoint. Read Log in to another region.
-
Your browser opens the Mondoo Console. If you aren't signed in to Mondoo, sign in.
-
The page Authorize Mondoo CLI says that Mondoo CLI wants to sign in to Mondoo as you. Check that it is the login you just started: Device names your machine, Client names the cnspec version, and Requested shows when the login began. If you didn't start it, select Deny.

-
Under Sign in to, select your organization. Then choose what the login is for:
- One space: select the space that receives your scan results.
- The whole organization: scans go to the organization, and its asset routing rules decide the space of each asset.
-
Select Approve.
-
Return to the terminal. cnspec confirms the login and says when it ends:
✓ Logged in as sasha@lunalectric.com · space Lunalectric/Production · valid until 2026-12-01 17:30 CET (8h)
You can now scan. For example:
cnspec scan localIf the browser does not open
cnspec prints the URL it tried to open. Open it in any browser, approve the login, and paste the code the page shows into the terminal.
Log in without a browser on the machine
On a machine without a browser, for example over SSH, cnspec logs you in with a one-time code. You can also ask for this:
cnspec login --no-browsercnspec prints a one-time code and a URL:
! First copy your one-time code: WXYZ-1234
Open https://app.mondoo.com/activate?region=US in a browser and enter the code.Open the URL in a browser on any device, sign in to Mondoo, enter the code, and continue as in steps 3 to 5 above. The terminal confirms the login when you are done.
If the machine does have a browser and you didn't pass --no-browser, cnspec also offers to open the page there: press Enter.
The code is valid for 10 minutes. If it runs out before you approve, run the command again.
Log in to another region
A login belongs to one region, and cnspec login uses the US region unless you say otherwise. If your organization is in another region, pass that region's API endpoint:
cnspec login --api-endpoint https://eu.api.mondoo.comIf the page in the browser has no organization or space to choose, you are most likely in the wrong region.
cnspec stores the endpoint with the login, so later commands such as cnspec scan don't need the flag.
What a login can do
A login is you: Mondoo records scans and results under your user, and you can never do more with it than your own permissions allow. It is also narrower than you:
- It works in the space or organization you chose, and nowhere else.
- It can scan and report results, and fetch the policies a scan needs.
- It cannot change anything else. Commands that manage policies and frameworks, such as
cnspec policy uploadandcnspec policy list, are refused. Run those with a registered cnspec. - It ends after 8 hours and is not renewed. Run
cnspec loginagain to continue.
While a login is valid, cnspec login only confirms it:
✓ Already logged in as sasha@lunalectric.com · space Lunalectric/Production · valid until 2026-12-01 17:30 CET (6h)
Run "cnspec logout" first, or "cnspec login --force" to log in again.To log in again anyway, for example for another space, run cnspec login --force.
On a machine that is already registered
cnspec login keeps an existing registration and does not start a browser login. To log in as
yourself on such a machine, keep the login in its own configuration file and name that file when
you scan:
cnspec login --config ~/.config/mondoo/login.yml
cnspec scan local --config ~/.config/mondoo/login.ymlSee and end your logins
To log out from the terminal:
cnspec logoutThis ends the login on Mondoo Platform and removes it from the configuration file.
To revoke a login from the Mondoo Console:
- In the top right corner of the Mondoo Console, select your user icon and then User Settings.
- Select Authentication.
- Under Active sessions, find the login. Each row shows the device, the client, what the login can do, what it is signed in to, and when it expires.
- Select Revoke and confirm.
A revoked login stops working within a few minutes. Owners and editors of a space or an organization also see its logins under Active sessions in the space or organization settings, and can revoke them there.
Troubleshoot
| What you see | What it means | What to do |
|---|---|---|
browser login is not enabled on this server — use cnspec login --token | The Mondoo Platform you are connecting to does not offer browser login. | Register cnspec with a token. |
| The page has no organization or space to choose | Your account has no access in this region. | Log in to another region. |
the login request was denied | The login was denied in the browser. | Run cnspec login again and select Approve. |
the login request expired before it was approved | The one-time code ran out. | Run cnspec login --no-browser again and approve within a few minutes. |
your login ended at ... | The login ended after 8 hours. | Run cnspec login. |
the server no longer accepts your login: it has ended or was revoked | The login was revoked in the Mondoo Console, or it ended. | Run cnspec login. |
no valid permissions to access the resource from a cnspec policy command | A login can scan. It cannot manage policies. | Run the command with a registered cnspec. |
client is already logged in, skipping | cnspec on this machine is registered, and cnspec login keeps the registration. | Use a separate configuration file, as described under What a login can do. |
run cnspec login in a terminal, or pass a registration token | cnspec login is not running in a terminal, so nobody can approve a login. | Run it in a terminal, or register cnspec for a machine that runs unattended. |
Last updated on