FAQ. Resetting the password and unlocking the administrator

Материал из WiKi - UserSide
Версия от 10:45, 1 апреля 2024; N.Skrypnik (обсуждение | вклад)
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

en | ru

First, make sure that you are using local authentication and not authentication through an LDAP server. The following instructions apply to local authentication only. If you have LDAP authentication, contact the administrator who manages the LDAP server (or AD).

Starting from version 3.19

User unlock and password reset work exactly the same as for version 3.18.

Reset 2FA binding

Starting from version 3.19, if two-factor authentication is active, you can reset the 2FA binding for a user with the command:

php run credentials/g2fa-reset admin

Starting from version 3.18

Use the instructions for version 3.16 but instead of php userside use php run.

Password reset

php run credentials/password-reset admin

Unlocking

php run credentials/unblock admin

Starting from version 3.16

Starting from version 3.16, a console command is available to manage user accounts:

php userside credentials

By default, the list of users and account lock status is displayed.

The command must be entered while in the userside directory (by default /var/www/userside).

Password reset

To reset the user password, run the command:

php userside credentials/password-reset admin

The password for the account with the username admin will be reset. Command output:

Done! New password for username admin is: dGQl48me34pl7C

Unlocking

To unlock a locked account, run the command:

php userside credentials/unblock admin

Unlocks the account with the username admin if it was locked. Command output:

Done! Username admin was unblocked successfully.

Older versions 3.13...3.15

In versions from 3.13 to 3.15 inclusive, use an SQL query.

The examples below use the database name userside and the account username: admin. Change to yours, if different, before running these queries.

Password reset

Open the psql console and run the query there:

sudo -u postgres psql -d userside

UPDATE credentials
SET password_hash = '$2y$13$9tw/ZxVyN4TG7nwyzSJjy.qhrtojPibTizH00KEZsBDpLJ7eU5Ob.'
WHERE username = 'admin';

After running the command, log in with password 1234 and change it to a secure password.

Unlocking

sudo -u postgres psql -d userside -c "UPDATE credentials SET is_block = false WHERE username = 'admin'"

It's almost ancient, but it's still cool, 3.12

Password reset

sudo -u postgres psql -d userside -c "UPDATE userside3.pbl_oper SET pass = '838787c84ef318aa49d61c0eca871605' WHERE oper = 'Admin'"

Unlocking

sudo -u postgres psql -d userside -c "UPDATE userside3.pbl_oper SET locked = 0 WHERE oper = 'Admin'"

Ancient versions by 3.11

In versions 3.11 and older, credentials are stored in a MySQL database. Queries must be performed for MySQL!

Password reset

mysql -u user_name -p -D userside -e "UPDATE tbl_oper SET PASS = '838787c84ef318aa49d61c0eca871605' WHERE OPER = 'Admin'"

After running the command, log in with password 1234 and change it to a secure password.

Unlocking

mysql -u user_name -p -D userside -e "UPDATE tbl_oper SET LOCKED = 0 WHERE OPER = 'Admin'"