Page 1 of 1

Web interface username & password

Posted: 31 Mar 2015 10:08
by alkarakiomar
Dear All

Kindly note that i'm a new here and this is the first time that i'm using Efa, i configured the VM, and i have the root pssword, but when i try to use the web interface i cannot login.

could you please guide me that how i can login to it.

Thank you

Re: Web interface username & password

Posted: 31 Mar 2015 13:48
by DaN

Re: Web interface username & password

Posted: 01 Apr 2015 09:19
by alkarakiomar
Hi

I follow the below link and i use the below command

/usr/bin/mysql -u mailwatch -p XXXXXXXXX mailscanner -e "UPDATE users SET password = md5('XXXXXXX') WHERE user=admin'"

but still i cannot access the web interface.

Waiting your feedback

Re: Web interface username & password

Posted: 01 Apr 2015 10:54
by DaN
I'm not sure, but it seems that there is no space in "-p<MailwatchPWD>".
Do you consider this?

user=admin'
should be
user='admin'"

/usr/bin/mysql -u mailwatch -pMailwatchPWD mailscanner -e "UPDATE users SET password = md5('YourNewUserPassword') WHERE user='YourUsername'"

Re: Web interface username & password

Posted: 01 Apr 2015 13:36
by shawniverson

Re: Web interface username & password

Posted: 05 Apr 2015 09:56
by alkarakiomar
Thank you for you reply but still not working

I use the below command exactly , and I add ' before admin

/usr/bin/mysql -u mailwatch -p XXXXXXXXX mailscanner -e "UPDATE users SET password = md5('XXXXXXX') WHERE user='admin'"
but when i press Enter it will give me" the attached file "
and when I re-login to Web interface it's fail login.

Thank you for your support

Re: Web interface username & password

Posted: 07 Apr 2015 07:40
by DaN
You still have a blank space between -p and password!?

Re: Web interface username & password

Posted: 07 Apr 2015 07:57
by darky83
Please keep in mind that the username is the user you gave during the setup.

You can list your users with the command:

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "select * from users"
To reset use the mentioned reset command.

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = md5('YOURPASSWORD') WHERE user='YOURUSERNAME'"
and ofcourse change yourusername and yourpassword.

Re: Web interface username & password

Posted: 07 Apr 2015 12:16
by alkarakiomar
Dear Dark83

Kindly note that i run that command but nothing change still i cannot access the web interface.( Checked the attached file error_2).

could you please advice me , what shall i do , and as i told you that i have the root password, but my problem only when that i cann't access the web interface. ( error_3)

waitting your advice.

Thank you

Re: Web interface username & password

Posted: 07 Apr 2015 12:53
by darky83
Are you sure your username is 'admin'?

You entered the username during the initial setup, so if you entered something else then you need to use that username instead of 'admin'.

(also you forgot the backticks (`) so the command you entered does not work. :whistle: )

First try to get a list of your users with the command:

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "select * from users"
This should output atleast 1 row that contains an username.

Re: Web interface username & password

Posted: 08 Apr 2015 08:34
by alkarakiomar
Appreciate you support first of all.

but my friend i run the command so many times, and i got a new error ( check the attached file ).

i don't know what shall i do now,k because i fed up :)

Waiting your feedback

Re: Web interface username & password

Posted: 08 Apr 2015 09:05
by pdwalker
Do this first

Code: Select all

cat /etc/EFA-Config |grep SQL|grep MAILWATCHSQLPWD
You should get one line back that looks like this:
MAILWATCHSQLPWD:XXX...XXX
where XXX...XXX is your mysql password.

If you do, type in

Code: Select all

mysql -umailwatch -pXXX...XXX mailscanner
it will succeed or fail.

if it fails, do this

Code: Select all

cat /etc/EFA-Config |grep SQL|grep MYSQLROOTPWD
You should get back a line like
MYSQLROOTPWD:YYY....YYY
where YYY...YYY is your mysql root password.

if you do, type in

Code: Select all

mysql -uroot -pYYY...YYY mailscanner
If either mysql command works and you are connected to the database, type in this

Code: Select all

select * from users;
post those results

Warning: do not post your passwords. We only need the results of the final query, or the results from the mysql command if they both failed.

Re: Web interface username & password

Posted: 08 Apr 2015 09:56
by darky83
Hi alkarakiomar

Try the methode pdwalker mentioned,

Looking at the screenshots you have some of the quotes wrong so it is not working the line should be:

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "select * from users"
Note after the -p it should be a backtick not a quote, same for the last one for mailscanner that is a backtick not a single quote :)
But try the way pdwalker mentioned, that way you don't have to use the longer command.

Re: Web interface username & password

Posted: 08 Apr 2015 15:42
by alkarakiomar
Hi Dark83
hope you are fine and everything is under control not like me :)

Please find the attached file ( error_5 :) ),

i follow all your steps but still it fail

Best regards,

Re: Web interface username & password

Posted: 09 Apr 2015 06:33
by DaN
Because he wrotes

/usr/...

Re: Web interface username & password

Posted: 09 Apr 2015 06:55
by darky83
Yup I see a whole lot of typing mistakes, make sure it is exactly as mentioned above.

Re: Web interface username & password

Posted: 09 Apr 2015 07:57
by pdwalker
yeah, until you get the commands typed in properly, it's hard to go forward.

use the commands as I've written them. It'll take a few more steps, but there are fewer changes to make a mistake.

Re: Web interface username & password

Posted: 10 Apr 2019 17:45
by anti-spam
Hi,

i have to change the administrator's password, did a try with the command below, but i always receive a error message :

[root@mx2 ~]# /usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = md5('my-new-password') WHERE user='adminefa'"
ERROR 1054 (42S22) at line 1: Unknown column 'user' in 'where clause'

Is there a other way to change this password ?
Thanks
Best regards

Re: Web interface username & password

Posted: 10 Apr 2019 18:24
by henk
the fieldname is username and not user

Code: Select all

select username, password from mailscanner.users;
+-------------------+-----------------------------+
| username | password |
+-------------------+-----------------------------+
| titi | $some password |
| tata@testdomain | $another password |

Re: Web interface username & password

Posted: 12 Apr 2019 12:39
by anti-spam
hi,

i'm sorry, but i'm not able to find how to change this password...
It's urgent, as we HAVE to change it a.s.a.p., as someone else have this password ... :(
Thanks

Re: Web interface username & password

Posted: 12 Apr 2019 22:59
by henk
show users and passwd's

Code: Select all

mysql -u root -p`cat /etc/EFA-Config | grep MYSQLROOTPWD | sed 's/.*://'` mailscanner -e "Select username, password from users"
update password for username: adminefa

Code: Select all

/usr/bin/mysql -u root -p`cat /etc/EFA-Config | grep MYSQLROOTPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = PASSWORD('mysecretpassword') WHERE username ='adminefa'"
TIP.
If you login to mysql -> use mailscanner; -> the update query is much easier. By creating a .my.cnf in your root directory , you can even login without typing (or grepping) passwords.

Re: Web interface username & password

Posted: 14 Apr 2019 09:59
by anti-spam
Hi,

i did a try with

/usr/bin/mysql -u root -p`cat /etc/EFA-Config | grep MYSQLROOTPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = PASSWORD('mysecretpassword') WHERE username ='adminefa'"

and now i'm haning with : Bad Username or Password
The password is changed, because the show command show me a other and shorter crypted password ...
Is there a other way, to reset it to the original password ?

Re: Web interface username & password

Posted: 14 Apr 2019 11:08
by henk
did the test, to be sure.

Create user tempadm with password dirkjan

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "INSERT INTO users SET username = 'tempadm', password = MD5('<dirkjan>'), fullname = 'tempadm', type ='A'"
Check if user is created ( and show the md5 pwd for 'dirkjan' )

Code: Select all

mysql -u root -p`cat /etc/EFA-Config | grep MYSQLROOTPWD | sed 's/.*://'` mailscanner -e "Select username, password,  MD5('dirkjan') as pwd  from users"
To update a password for user tempadm

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/EFA-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = MD5('dirkjan') WHERE username = 'tempadm'"
After the first time login the password changes in the db.

Check to see the difference

Code: Select all

mysql -u root -p`cat /etc/EFA-Config | grep MYSQLROOTPWD | sed 's/.*://'` mailscanner -e "Select username, password,  MD5('dirkjan') as pwd  from users"

Via Tools and link-> User Management you can change passwords (as user tempadm with password dirkjan is not a secret anymore :idea: )

Re: Web interface username & password

Posted: 14 Apr 2019 11:45
by anti-spam
:angry-banghead: :angry-banghead: :angry-banghead:

I was on that Tools and links, but i was to stupid to don't read the first line, User Managemant ...
I only did a search on "password" .... :violence-axechase:

I will have to learn to read more.
MANY thanks for your help.
Best regards

Re: Web interface username & password

Posted: 18 Nov 2019 04:08
by DJ_L
Since this is the first hit from Google, updated path and table for 4.x - the MailWatch Settings -> Reset MailWatch Admin did not work for me, presumably due to invalid characters in the password - as best I can tell, I was unable to set a password that contained a single quote (') character but I was unable to grasp that from the error message, so I resorted to the direct method (below, or as per above).

To list users:

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/eFa/MailWatch-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "select * from users"
To change the password:

Code: Select all

/usr/bin/mysql -u mailwatch -p`cat /etc/eFa/MailWatch-Config | grep MAILWATCHSQLPWD | sed 's/.*://'` mailscanner -e "UPDATE users SET password = md5('password') WHERE username='admin'"
HTH