If you, just like me, forgot the admin password of your rather fresh ownCloud 6 installation, you can reset it using the following steps:
- Log into the server hosting your owncloud installation
- Navigate to the sites directory (ie: /var/www/owncloud)
- Fetch the salt from ./config/config.php
- Navigate to the ‘phppass’ 3rd party app (ie: /3rdparty/phpass)
- edit the test.php file and replace the following:
- edit $correct = ’test12345′; to $correct = ‘yournewpass’.’yourconfigpasswordsalt’;
- Run ‘php test.php’
- Revert changes to test.php
- Copy the first line that has ‘Hash: $2a…’
- Log into your database (MySQL is the example)
- mysql -u root -p
- use owncloud;
- select * from oc_users;
- Note the password value, copy it just in case
- update oc_users set password= ‘generatedhash’ where uid = ‘admin’;
That’s it, you can now login using the new password.
Reference:
Nobody
Awesome, thanks!
If you get this error message:
ERROR 1146 (42S02): Table ‘owncloud.oc_user’ doesn’t exist
try oc_users instead of oc_user
lambert
Thanks for the update. It is indeed oc_users instead of oc_user. I corrected the post.
Dimi
It works!! Thank you very much!