> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I log to the right wandb user on a shared machine?

When multiple users share a machine, runs can log to the wrong W\&B account if you don't explicitly set credentials. To ensure that runs log to the correct W\&B account, set the `WANDB_API_KEY` environment variable for authentication. When you source this variable in the environment, it provides the correct credentials upon login. Alternatively, set the environment variable directly in the script.

To associate subsequent W\&B runs in this shell session with your account, export your API key: `export WANDB_API_KEY=[API-KEY]`. Replace `[API-KEY]` with your API key, which you can create at [wandb.ai/settings](https://wandb.ai/settings).

***

<Badge stroke shape="pill" color="orange" size="md">[Logs](/support/models/tags/logs)</Badge>
