Reset Admin Password


#1

I forgot the admin password, How to reset it, Please help.

Detail:
I installed mailinabox few weeks ago and it did not worked for me.
Now I explored documentation and executed command sudo mailinabox and it worked.
Finally I can see login screen now. But Now I forgot the admin password. Please tell me how to reset it.
What is the path of password file?
I have root access to server.

Thanks in Advance


Mail Administrator Deserted
#2

Log into the box using SSH (same as when you set up the box). Then run:

sudo /root/mailinabox/tools/mail.py user password your@address.com

Replacing your@address.com with the email address that you created when you created the box (or whatever your admin account email address is).

Run

sudo /root/mailinabox/tools/mail.py

for a full list of commands.


#3

That solved my issue.

Thank you a lot for quick support. Mail-in-a-box is very usefull package and This forum gives best support
Thanks again


#4

Hello, I am having the same issue … I have forgotten the admin password.

When following the instructions in this post I get the following:

password:
(again):
Traceback (most recent call last):
File “./mailinabox/tools/mail.py”, line 99, in
print(mgmt("/mail/users/password", { “email”: email, “password”: pw }))
File “./mailinabox/tools/mail.py”, line 9, in mgmt
setup_key_auth(mgmt_uri)
File “./mailinabox/tools/mail.py”, line 47, in setup_key_auth
key = open(’/var/lib/mailinabox/api.key’).read().strip()
PermissionError: [Errno 13] Permission denied: ‘/var/lib/mailinabox/api.key’

Can anyone offer some help? Thanks in advance!


#5

Run with sudo! the last line tells you the problem “PermissionError” means you ran the command as normal user. Run with Root.

sudo ./home/username/mailinabox/tools/mail.py user password user@domain.com


#6

I think @murgero is correct that this is a permissions issue, but the path in the command s/he gave is incorrect. See @JoshData’s earlier post for the correct command, and ensure you include sudo at the start.


#7

@sdlg My command is correct for my system. “username” is replaced with the users login name, Since I do not use root to login, when I install MIAB it’s tools and scripts are put in /home/username/mailinabox" but if doing it directly from the root account it will be in /root/mailinabox.


#8

Great. For everyone who isn’t logged into your Box, though, @JoshData’s answer is correct.


#9

I am not denying @JoshData’s answer, I just followed the install instructions and that is how it was installed for me. For most people, I would assume the same unless using a VPS with only root access. :slight_smile: Cheers!


#10

Logged in a standard user with sudo privilege and in my /home folder I had to run

sudo mailinabox/tools/mail.py user password your@address.com 

I was receiving the following

sudo: /root/mailinabox/tools/mail.py: command not found


#11

Then …

sudo /home/username/mailinabox/tools/mail.py user password

substitute username with the system user account that you used when installing MiaB.