Home » Linux » Redmine密码重置

Reset password lost without admin redmine account but with admin redmine database account
Found in file /app/models/user.rb: 'The hashed password is stored in the following form: SHA1(salt +SHA1)'
So you can reset password in two steps:

  • clear salt
  • calculate sha1(sha1(new_password))

    For example for the password "password" (without quote) it will be

You have to go to redmine database, find "users" table, find user to reset password, clear "salt" field's user and put "353e8061f2befecb6818ba0c034c632fb0bcae1b" in "hashed_password" field's user and log to redmine with new password 'password' (without quote). To do this redmine database changes, do the following from command line in the operating system where Redmine is working:
note user and password from a file config/database.yml.
execute command:mysql -uroot -p
enter: password
execute:use redmine;
execute:UPDATE users SET hashed_password='353e8061f2befecb6818ba0c034c632fb0bcae1b' WHERE login='admin';
execute:UPDATE users SET salt='' WHERE login='admin';
Now you can go to Redmine login web page to login as user admin with 'password' as password.

标签: MySQL redmine password