admin password

6,338 views
Skip to first unread message

lucas

unread,
Jan 12, 2012, 8:37:09 AM1/12/12
to web2py-users
hello one and all,

i am stupid. i forgot the web2py admin password on my server and i
can't access the https interface. how can i change the password? is
there a simple script i can run as root or something?

thanx in advance. i know the technique is somewhere, i just can't
find it. lucas

Anthony

unread,
Jan 12, 2012, 9:01:35 AM1/12/12
to web...@googlegroups.com
The hashed password is stored in /web2py/parameters_[port number].py like this:

password="[hashed password]"

The hash is created via CRYPT()(password)[0], so you could replace that file with your new hashed password. The Ubuntu setup script does the following to prompt for a new password and automatically create the appropriate file:

cd /home/www-data/web2py
sudo -u www-data python -c "from gluon.widget import console; console();"
sudo -u www-data python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)"

The gluon.main.save_password function takes the password and the port and creates the appropriate parameters_*.py file.

Anthony

Alexandre Andrade

unread,
Jan 12, 2012, 10:24:13 AM1/12/12
to web...@googlegroups.com
just stop the web2py server (or apache) and run in console:

# python web2py


it will ask you a new password


Alexandre Andrade

2012/1/12 lucas <sjlu...@gmail.com>



--
Atenciosamente


Alexandre Andrade
Hipercenter.com Classificados Gratuitos

Alexandre Andrade

unread,
Jan 12, 2012, 10:27:40 AM1/12/12
to web...@googlegroups.com
completing


just stop the web2py server (or apache) and run in console:

# python web2py


it will ask you a new password

look at port it runs (like 8000)

and copy the file to run in port 443 (https):
# cp parameters_8000.py parameters_443.py

 
Alexandre Andrade


2012/1/12 Alexandre Andrade <alexand...@gmail.com>

Kathryn Gray

unread,
Jul 29, 2013, 6:55:17 AM7/29/13
to web...@googlegroups.com
Hi there

I have a similar issue, on the admin login page my password isn't accepted although i'm quite confident it is correct. When i enter something random an the orange bar show "invalid password", when i enter my password  the orange bar is blank but it does not proceed to another page.

Anyway, when i tried # python web2py in lx terminal (i'm doing this on a raspberry pi) I get " python: can't open 'web2py': [Ernno 2] No such file or directory.

Can anyone help?

Many thanks

dhmorgan

unread,
Jul 29, 2013, 10:38:19 AM7/29/13
to web...@googlegroups.com
"python web2py.py"
Reply all
Reply to author
Forward
0 new messages