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
    "353e8061f2befecb6818ba0c034c632fb0bcae1b"
    sah1(password)=0bd181063899c9239016320b50d3e896693a96df
    sha1(0bd181063899c9239016320b50d3e896693a96df)=353e8061f2befecb6818ba0c034c632fb0bcae1b

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.
For MySQL
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';
execute:exit
Now you can go to Redmine login web page to login as user admin with 'password' as password.

标签: MySQL redmine password

添加新评论

V