Web interface username & password

Questions and answers about how to do stuff
Post Reply
alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Web interface username & password

Post 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
alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Re: Web interface username & password

Post 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
DaN
Posts: 240
Joined: 19 Nov 2014 10:04
Location: Earth

Re: Web interface username & password

Post 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'"
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Web interface username & password

Post by shawniverson »

alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Re: Web interface username & password

Post 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
Attachments
error.JPG
error.JPG (50.82 KiB) Viewed 39532 times
DaN
Posts: 240
Joined: 19 Nov 2014 10:04
Location: Earth

Re: Web interface username & password

Post by DaN »

You still have a blank space between -p and password!?
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Web interface username & password

Post 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.
Version eFa 4.x now available!
alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Re: Web interface username & password

Post 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
Attachments
Error_3.JPG
Error_3.JPG (33.11 KiB) Viewed 39506 times
Error_2.JPG
Error_2.JPG (36.64 KiB) Viewed 39506 times
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Web interface username & password

Post 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.
Version eFa 4.x now available!
alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Re: Web interface username & password

Post 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
Attachments
error_4.JPG
error_4.JPG (34.64 KiB) Viewed 39498 times
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Web interface username & password

Post 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.
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Web interface username & password

Post 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.
Version eFa 4.x now available!
alkarakiomar
Posts: 6
Joined: 31 Mar 2015 09:52

Re: Web interface username & password

Post 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,
Attachments
error_5.JPG
error_5.JPG (92.96 KiB) Viewed 39492 times
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Web interface username & password

Post by darky83 »

Yup I see a whole lot of typing mistakes, make sure it is exactly as mentioned above.
Version eFa 4.x now available!
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Web interface username & password

Post 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.
anti-spam
Posts: 40
Joined: 06 Oct 2015 14:32
Contact:

Re: Web interface username & password

Post 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
:arrow: always fighting spams ... :hand:
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: Web interface username & password

Post 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 |
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
anti-spam
Posts: 40
Joined: 06 Oct 2015 14:32
Contact:

Re: Web interface username & password

Post 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
:arrow: always fighting spams ... :hand:
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: Web interface username & password

Post 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.
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
anti-spam
Posts: 40
Joined: 06 Oct 2015 14:32
Contact:

Re: Web interface username & password

Post 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 ?
:arrow: always fighting spams ... :hand:
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: Web interface username & password

Post 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: )
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
anti-spam
Posts: 40
Joined: 06 Oct 2015 14:32
Contact:

Re: Web interface username & password

Post 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
:arrow: always fighting spams ... :hand:
DJ_L
Posts: 4
Joined: 29 Nov 2014 01:47

Re: Web interface username & password

Post 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
Post Reply