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?
Asked
Active
Viewed 1,650 times
2 Answers
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
-
not really helpful when you are on a plain webhoster without SSH – My1 Nov 28 '17 at 14:27