---
title: luna logout
description: End this machine's login and remove it from the machine.
related:
  - /cli/login
  - /concepts/keys-and-tokens
  - /cli/tokens
---

`luna logout` ends the login `luna login` saved on this machine, and removes it.

```bash
luna logout
```

## Reference

```bash
luna logout
```

The command takes no options of its own.

## Good to know

- The command revokes the login's account key at Luna, then removes it from `~/.luna/credentials.json`. The key is removed from this machine even when Luna cannot be reached.
- The organisation `luna orgs use` chose is forgotten with the login.
- Running it on a machine that is not logged in changes nothing.
- An API token in `LUNA_TOKEN` is not a login, and `luna logout` leaves it alone. End one with [`luna tokens revoke`](/cli/tokens).

## Examples

### Log out of this machine

```bash
luna logout
```

### Log out and back in as someone else

```bash
luna logout && luna login
```
