# Admin locked out with no email enabled

**URL:** <https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836>\
**Category:** Troubleshooting\
**Created:** [August 5, 2019, 3:15pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836 "2019-08-05T15:15:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [August 5, 2019, 3:15pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/1 "2019-08-05T15:15:27Z")

</div>

Hello everybody,  
I am running Mattermost (5.0.0.7) on a QNAP NAS with no email communication enabled and I locked my admin account out.

I connected via ssh to the folder where (I believe) the server is installed to try and use the CLI tools but the command “mattermost” is not recognized.

The folder where I’m looking for the installation has the following contents:

> docker-compose.yml images/ log/ mattermost.sh\* NOTICE.txt volumes/ flags/ LICENSE.txt mattermost.conf nginx/ utils/

Is there a way to reset my admin’s password?

PS: I am not very familiar with docker (or with qnap and .qpkg), does the .yml file mean mattermost is running on a container? If so, could I access said container like [this](https://forum.mattermost.com/t/solved-password-reset-without-email/2230/6)?

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [August 15, 2019, 12:18pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/2 "2019-08-15T12:18:02Z")

</div>

Hi @McMa,

Normally [this command](https://docs.mattermost.com/administration/command-line-tools.html#mattermost-user-password) is used. What happens when the command doesn’t work?

For all your other questions in the last paragraph, the answer is yes.

---

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [August 19, 2019, 8:08am UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/3 "2019-08-19T08:08:41Z")

</div>

Hi @amy.blais,  
thanks for your answer. The command is not recognized, this is, whenever I type a command starting with `mattermost` I get the error

> -sh: mattermost: command not found

even though I assume I am in the correct installation directory.

---

<div class="post-metadata">

**Author:** ![sven.huester](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sven.huester/32/8724_2.png) [@sven.huester](https://forum.mattermost.com/u/sven.huester)\
**Post date:** [August 21, 2019, 10:49am UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/4 "2019-08-21T10:49:55Z")

</div>

Hi @McMa, would you mind runnning `locate mattermost` and post the output here?

I’m very certain the mattermost binary is installed to a different location we just have to find out where 🙂

---

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [August 21, 2019, 11:23am UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/5 "2019-08-21T11:23:43Z")

</div>

Hi @sven.huester and thank you for embarking with me in this pathetic adventure 😄

I cannot run the `locate` command (`-sh: locate: command not found`) because I’m running this on a QNAP NAS\*. Assuming I could find the location where Matermost is installed, I would have to switch to that directory and run the command `mattermost user password ...` there, right?

On the other hand, if Mattermost is running in a container, would I be able to find the directory where it is “installed”?

\*`[~]# cat /etc/os-release`  
`NAME="QTS" VERSION="4.3.6 (20190531)" ID=qts PRETTY_NAME="QTS 4.3.6 (20190531)" VERSION_ID="4.3.6"`

---

<div class="post-metadata">

**Author:** ![sven.huester](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sven.huester/32/8724_2.png) [@sven.huester](https://forum.mattermost.com/u/sven.huester)\
**Post date:** [August 21, 2019, 11:40am UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/6 "2019-08-21T11:40:27Z")

</div>

Absolutely no problem @McMa!

Regarding the container question, that’s completely up to the creator/maintainer of said container. In our official docker containers Mattermost is located at `/mattermost/` in our official documentation we recommend installing it to `/opt/mattermost` and in the docker containers for Gitlab Mattermost is spread all over the place.

But coming back to your original message, yes if you find the mattermost binary you only have to run the previously mentioned command `mattermost user password ...`

You could also try finding the binary using `find / -name mattermost`. Let me know if it works.

---

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [August 22, 2019, 8:42am UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/7 "2019-08-22T08:42:05Z")

</div>

I ran the `find` command and got the following directories/files:

> /share/CACHEDEV1\_DATA/.qpkg/mattermost  
> /share/CACHEDEV1\_DATA/.qpkg/mattermost/nginx/conf/sites-available/mattermost  
> /share/CACHEDEV1\_DATA/.qpkg/mattermost/volumes/app/mattermost  
> /share/CACHEDEV1\_DATA/.qpkg/container-station/system-docker/overlay2/4e2050228982c6a4393d702e084a221af70f34078e9fc533e5bd1020265f2b65/diff/mattermost  
> /share/CACHEDEV1\_DATA/.qpkg/container-station/system-docker/overlay2/4e2050228982c6a4393d702e084a221af70f34078e9fc533e5bd1020265f2b65/diff/mattermost/bin/mattermost  
> … (other 4 paths similar to this pair)…  
> /share/CACHEDEV1\_DATA/.qpkg/container-station/system-docker/overlay2/ece0ef2e6d4d75b856a5cfc39d759f57bd831acd877c2116767abaf5fdfa7cea/merged/mattermost  
> /share/CACHEDEV1\_DATA/.qpkg/container-station/system-docker/overlay2/ece0ef2e6d4d75b856a5cfc39d759f57bd831acd877c2116767abaf5fdfa7cea/merged/mattermost/bin/mattermost

I tried the `mattermost` command in all directories to the same outcome: `-sh: mattermost: command not found `  
Any ideas?

---

<div class="post-metadata">

**Author:** ![sven.huester](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/sven.huester/32/8724_2.png) [@sven.huester](https://forum.mattermost.com/u/sven.huester)\
**Post date:** [August 22, 2019, 12:58pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/8 "2019-08-22T12:58:20Z")

</div>

It looks like there are several possibilities here.  
So first of we should check if Mattermost is running inside a docker container here.  
Can you run the command `docker ps` and see if it returns anything (or is even installed)?

---

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [August 22, 2019, 1:22pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/9 "2019-08-22T13:22:21Z")

</div>

`docker ps` returns  
`Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`

if I run the docker daemon using the command `dockerd` in thse same directory and then `docker ps` I get the following empty list:  
`CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES`

---

<div class="post-metadata">

**Author:** ![McMa](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@McMa](https://forum.mattermost.com/u/McMa)\
**Post date:** [September 13, 2019, 3:18pm UTC](https://forum.mattermost.com/t/admin-locked-out-with-no-email-enabled/7836/10 "2019-09-13T15:18:39Z")

</div>

found the images, they were running under `system-docker`.  
I used following command to access them:  
`system-docker exec -it mattermost_app_1 /bin/sh`
