Sebagai sistem administrator, adakalanya lupa dengan password admin, kalau password pengguna dengan mudah reset password melalui akun admin, nah kalau yang lupa itu adalah password admin, gimana resetnya? Berikut ini cara yang benar-benar ampuh untuk reset password admin dari OwnCloud, yang sedang saya implementasikan adalah OwnCloud versi 7.
1. Login ke server hosting, dalam kasus ini saya menggunakan Putty untuk kemudian koneksi ke server melalui SSH
2. Arahkan ke direktori situs dari owncloud, misalnya: /var/www/owncloud
1 |
#cd /var/www/owncloud |
3. Lalu masuklah ke direktori phpass yang berada di dalam direktori 3rdparty
1 |
#cd 3rdparty/phpass |
4. Edit file file test.php, tapi sebelumnya lakukan backup file tersebut
1 2 |
#cp test.php test.php.ori #vi test.php |
Lakukan konfigurasi berikut ini:
1 2 3 4 5 6 |
#$t_hasher = new PasswordHash(8, FALSE); $t_hasher = new PasswordHash(8, CRYPT_BLOWFISH!=1); #edit $correct = ‘test12345′; #$correct = 'yournewpass'.'yourconfigpasswordsalt'; $correct = 'passwordbaruku'.'4838c371610baa70a9e7ae228d56c4'; |
Untuk mendapatkan [yourconfigpasswordsalt], lihat di file config dari OwnCloud (config/config.php). Pada setiap Owncloud konfigurasi salt password akan berbeda-beda. Misalnya:
1 2 3 4 5 6 7 8 |
$CONFIG = array ( 'instanceid' => 'oc13b167f3er', 'passwordsalt' => '4838c371610baa70a9e7ae228d56c4', 'trusted_domains' => ... ... ... ) |
5. Pada jendela command line ketik perintah berikut
1 |
# php test.php |
Hasilnya kurang lebih seperti ini
1 2 3 4 5 6 7 8 9 10 11 |
# php 3rdparty/phpass/test.php Hash: $2a$08$KNT60IUbztKQzfHzkAw0CuwPeFc1tV7VcX8tcsOEN8sBx4XBNGtqq Check correct: '1' (should be '1') Check wrong: '' (should be '0' or '') Hash: $P$BITG3SwUKTDZR/vZD5tuDe1Ox9bBZL1 Check correct: '1' (should be '1') Check wrong: '' (should be '0' or '') Hash: $P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0 Check correct: '' (should be '1') Check wrong: '' (should be '0' or '') Some tests have FAILED |
6. Copy baris pertama Hash: $2a$08$KNT60IUbztKQzfHzkAw0CuwPeFc1tV7VcX8tcsOEN8sBx4XBNGtqq
7. Login ke database, MySQL misalnya, lalu update password dari user admin
1 |
UPDATE oc_user SET password='$2a$08$KNT60IUbztKQzfHzkAw0CuwPeFc1tV7VcX8tcsOEN8sBx4XBNGtqq' WHERE UID='youruser' |
8. Lalu lakukan login kembali.