FAQ. Resetting the password and unlocking the administrator: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
 
Строка 1: Строка 1:
[[FAQ._Resetting_the_password_and_unlocking_the_administrator|en]] | [[FAQ._Сброс_пароля_и_разблокировка_администратора|ru]]
[[FAQ._Resetting_the_password_and_unlocking_the_administrator|en]] | [[FAQ._Сброс_пароля_и_разблокировка_администратора|ru]]


=== From version 3.16 ===
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 <code>php userside</code> use <code>php run</code>.
 
==== 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:
Starting from version 3.16, a console command is available to manage user accounts:
  php userside credentials
  php userside credentials
By default, a list of users and the status of locked accounts is displayed.
By default, the list of users and account lock status is displayed.


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


==== Reset password ====
==== Password reset ====
To reset a user's password, run the command:
To reset the user password, run the command:
  php userside credentials/password-reset admin
  php userside credentials/password-reset admin
The password for the admin user account will be reset.
The password for the account with the username admin will be reset.
Command output:
Command output:
  Done! New password for username admin is: dGQl48me34pl7C
  Done! New password for username admin is: dGQl48me34pl7C


==== Unlock ====
==== Unlocking ====
To unlock a locked account, run the command:
To unlock a locked account, run the command:
  php userside credentials/unblock admin
  php userside credentials/unblock admin
This will unlock the admin user account if it has been locked.
Unlocks the account with the username admin if it was locked.
Command output:
Command output:
  Done! Username admin was unblocked successfully.
  Done! Username admin was unblocked successfully.


=== Older versions 3.12...3.15 ===
=== Older versions 3.13...3.15 ===


For versions 3.12 to 3.15 included, use a SQL query.
In versions from 3.13 to 3.15 inclusive, use an SQL query.


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


==== Reset password ====
==== Password reset ====
sudo -u postgres psql -d userside -c "UPDATE credentials SET password_hash = '$2y$13$9tw/ZxVyN4TG7nwyzSJjy.qhrtojPibTizH00KEZsBDpLJ7eU5Ob.' WHERE username = 'admin'"
Open the psql console and run the query there:
After executing the command, log in with the password 1234 and change it to a secure password.
<pre>
sudo -u postgres psql -d userside


==== Unlock ====
UPDATE credentials
SET password_hash = '$2y$13$9tw/ZxVyN4TG7nwyzSJjy.qhrtojPibTizH00KEZsBDpLJ7eU5Ob.'
WHERE username = 'admin';
</pre>
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'"
  sudo -u postgres psql -d userside -c "UPDATE credentials SET is_block = false WHERE username = 'admin'"


=== Old versions up to 3.11 ===
=== It's almost ancient, but it's still cool, 3.12 ===
In versions 3.11 and older, the credentials are stored in the MySQL database. Queries must be performed for MySQL!
 
==== 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!


==== Reset password ====
==== Password reset ====
  mysql -u имя_пользователя -p -D userside -e "UPDATE tbl_oper SET PASS = '838787c84ef318aa49d61c0eca871605' WHERE OPER = 'Admin'"
  mysql -u user_name -p -D userside -e "UPDATE tbl_oper SET PASS = '838787c84ef318aa49d61c0eca871605' WHERE OPER = 'Admin'"
After executing the command, log in with the password 1234 and change it to a secure password.
After running the command, log in with password 1234 and change it to a secure password.


==== Unlock ====
==== Unlocking ====
  mysql -u имя_пользователя -p -D userside -e "UPDATE tbl_oper SET LOCKED = 0 WHERE OPER = 'Admin'"
  mysql -u user_name -p -D userside -e "UPDATE tbl_oper SET LOCKED = 0 WHERE OPER = 'Admin'"

Текущая версия от 10:45, 1 апреля 2024

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'"