Ir al contenido
Menú
Se marcó esta pregunta
13 Respuestas
19302 Vistas

Guys, 

How to recover admin password if you don't have access to the email address or you just not set it before you changed a password and logged off from the system ?

I know, it is a stu..d question but it happens sometimes.

Couple of weeks ago My boss (he just love to do it) changed admin password then forgot. So I've had no other way  and recovered database from the backup I remember the password, however some data were lost, some of course we restored based on what people remembered.

SO, is there any other way to get into the system as a admin or change admin's password ?

Password in database is encrypted .....

By the way, admin is the only user with full access rights so none of the other users can change system parameters or passwords.

...........

...........

Of course there is  ............. a very simple way ............ to change it .............

...........

...........


Avatar
Descartar
Mejor respuesta

You could set a new password directly in the database at the res_users table, put your new password on the field "password" and set to empty the field password_crypt. After that just put the new password at the login page and you will be ok

Another way

Is doing the same as Odoo for encrypt the password and set the new_password to the password_crypt field, like:

from passlib.context import CryptContext
crypt_context = CryptContext(
['pbkdf2_sha512', 'md5_crypt'],
deprecated=['md5_crypt'],
)
new_password = crypt_context.encrypt(password)


Avatar
Descartar
Autor

A hahahaha, Hi Axel ..... yes in did :) I was just curious do people know about it ;)

So you are testing people here? :)

Autor

One point for you :)

Autor

It happened to me some time ago and I was looking for the way how to get an access :) and that was the easiest possible way. ;)

Autor

But the question was "how to recover" ;) if it is possible.

Autor

If you have no access to the database directly ;)

You cannot retrieve the old password because it's encrypted, see the answer update for another way to set the new password.

Autor

Thank you, and this is the substantial answer I expected the most :)

Mejor respuesta

An alternative method:

1. Allow the admin password to be reset.

insert into base_config_settings(auth_signup_reset_password) values(true); 
update res_partner set signup_type='reset', signup_token='rsvabcdefghijykalklk', signup_expiration=to_timestamp('20200411','YYYYMMDD') where id=(select partner_id from res_users where id=1); 

2. Reset the password

http://[ODOO SERVER]:[PORT]/web/reset_password?token=rsvabcdefghijykalklk&login=admin 
Avatar
Descartar
Mejor respuesta

Axel's alternative solution for Odoo 9.0 and newer simplified as command line commands can be found here:

https://github.com/odoo/odoo/issues/9806#issuecomment-255487372

Avatar
Descartar
Mejor respuesta

Another Way..................


First connect to postgressql 


Run this query in res_users table then u can login as admin and password=admin


update  res_users set password='admin'  where login='admin'

Avatar
Descartar
Autor

Thank you