# \[Solved\] Error: cannot read user credentials, maybe you need to use login first

**URL:** <https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916>\
**Category:** Troubleshooting\
**Created:** [May 15, 2023, 6:50pm UTC](https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916 "2023-05-15T18:50:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ONiel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/oniel/32/6787_2.png) [@ONiel](https://forum.mattermost.com/u/ONiel)\
**Post date:** [May 15, 2023, 6:50pm UTC](https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916/1 "2023-05-15T18:50:14Z")

</div>

I am trying to get started with Mattermost. I was able to launch it on AWS/Bitnami.

But when I try to execute a `mmctl` command I get the following error:

```auto
Error: cannot read user credentials, maybe you need to use login first: stat /home/bitnami/.config/mmctl/config: no such file or directory

```

How do I solve this?

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [May 20, 2023, 10:00am UTC](https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916/2 "2023-05-20T10:00:13Z")

</div>

Hi @ONiel and welcome to the Mattermost forums!

`mmctl` is a command line client which is using the API to connect to the Mattermost server by default, so you need to use the `mmctl auth login` command first to login to your local or remote instance. Once that’s done, a session token will be saved in `mmctl`’s config and you can use this token for all further commands.

Alternatively, you can enable Mattermost’s so-called “local mode” by changing the value of `EnableLocalMode` in its `config.json` to `true`and after a server restart, you can use the socket-authenticated `mmctl --local` with all available commands without having to do a separate login first.

---

<div class="post-metadata">

**Author:** ![devin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/devin/32/7308_2.png) [@devin](https://forum.mattermost.com/u/devin)\
**Post date:** [November 1, 2023, 6:53pm UTC](https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916/3 "2023-11-01T18:53:48Z")

</div>

I couldn’t get the changes to config file to persist so I resolved this outside of docker container

```auto
./mmctl auth login http://localhost:8065

```

Connection name didn’t seem to matter “Connection name: local-server”

Username and password of system admin did the trick

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [November 6, 2023, 11:13pm UTC](https://forum.mattermost.com/t/solved-error-cannot-read-user-credentials-maybe-you-need-to-use-login-first/15916/4 "2023-11-06T23:13:47Z")

</div>

Big thank you Devin for following up with the solution!
