1

I want to generate a nextcloud password from external, where can I find which salts and encryptions are used to store the password in the database?

Mathias Conradt
  • 28,420
  • 21
  • 138
  • 192
Asara
  • 2,791
  • 3
  • 26
  • 55

2 Answers2

2

the nextcloud password entry in the database is

1|$2y$10$hDoBSweagiX8g... (I cut it, because it's slightly longer but that isnt intresting)

I dont specifically know what the 1| part is but $2y$ definitely indicates a bcrypt hash with PHP's fixed behavior.

so I just tried making a quick bcrypt hash in an interactive PHP shell

php echo password_hash("password",PASSWORD_BCRYPT);

and entered the new bcrypt string right after the 1| and it worked

My1
  • 475
  • 5
  • 21
1

To reset the password of a user you can use the user:resetpassword action on the occ command. You can find the documentation on https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#user-commands-label.

Progman
  • 16,827
  • 6
  • 33
  • 48