Gui failure with 2.0 and resolution

Discussion in 'General' started by gazmac52, Nov 29, 2010.

  1. gazmac52

    Joined:
    Jun 3, 2009
    Messages:
    6
    Likes Received:
    0
    Hi, I installed 2.0 but the gui continually failed.
    After extensive searching and testing I found that the AMPDBPASS= password in /etc/amportal.conf was wrong.
    My password had '&'('and' or ampersand character) in it like this new&pass for example.
    The line in amportal.conf was like this:
    AMPDBPASS=newAMPDBPASS=eLaStIx.asteriskuser.2oo7s
    After changing it to:
    AMPDBPASS=new&pass everything worked fine.
    This causes problems with admin login as well. To change the admin login do this:
    at the command prompt type the following ( in any directory ):
    /usr/bin/sqlite3 /var/www/db/acl.db "UPDATE acl_user SET md5_password = '`echo -n newpass|md5sum|cut -d ' ' -f 1`' WHERE name = 'admin'"

    Change "newpass" to your desired new password.
    Do not use '&'('and' or ampersand character) in passwords when installing.

    Question, how do I change AMPDBPASS to a new pass without '&' in it? I do not want to re-install just to fix passwords.
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Answer, something like this:

    Code:
    NEWPASS=newpass
    echo "UPDATE asterisk.ampusers SET password_sha1=sha1('$NEWPASS') WHERE username = 'admin';" | mysql -u root -p`cat /etc/elastix.conf|grep mysqlrootpwd|cut -d '=' -f2`
    sed -i s"/^AMPDBPASS=.*/AMPDBPASS=$NEWPASS/" /etc/amportal.conf
    sed -i s"/^dbpass.*/dbpass = $NEWPASS/" /etc/asterisk/res_mysql.conf 
    sed -i s"/^password=.*/password=$NEWPASS/" /etc/asterisk/cbmysql.conf 
    sed -i s"/^password.*/password = $NEWPASS" etc/asterisk/cdr_mysql.conf 

    turn it into a script and it should work as a good prophylactic against hack-attacks if run every once in a while
    ref:

    http://bugs.elastix.org/view.php?id=598
     

Share This Page