Difference between revisions of "Administrative Account"
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
All accounts on [[MediaWiki]] are registered in the relational database ([[MySQL]]). Due to this design, in case you lost the admin password, which is the first user of the MediaWiki system, you must go to the database and change the password using SQL. Detailed instructions [https://hostlantern.com/clients/knowledgebase/807/How-to-reset-my-MediaWiki-admin-password.html here]: (Sample code is shown as follows) | |||
<syntaxhighlight lang=SQL> | |||
UPDATE user SET user_password = MD5( CONCAT( user_id, '-', MD5( 'NEWPASS' ) ) ) WHERE user_id =1; | |||
</syntaxhighlight> | |||
Otherwise, one can use the '''[[MW:Manual:changePassword.php| changePassword.php]]''' maintenance script. | |||
Just launch the following command in a terminal (command line interface) application. | |||
<syntaxhighlight lang=bash> | |||
php changePassword.php --user=target_username --password=new_password | |||
</syntaxhighlight> | |||
For detailed instructions, one can refer to MediaWiki's [[MW:Manual:Resetting passwords|Manual:Resetting passwords]]. | |||
The following instruction steps are inspired by the article<ref>https://www.cyberciti.biz/faq/add-new-user-account-with-admin-access-on-linux/</ref>: | The following instruction steps are inspired by the article<ref>https://www.cyberciti.biz/faq/add-new-user-account-with-admin-access-on-linux/</ref>: | ||
= | =Operating System Accounts= | ||
To add a new user account with administrator access, one must follow these steps: | To add a new user account with administrator access, one must follow these steps: | ||
# Log in to the system with root access, using a terminal applications. | # Log in to the system with root access, using a terminal applications. | ||
# Create a new user name, say | # Create a new user name, say '''xlp''', by using the <code>adduser</code> command: | ||
adduser xlp | adduser xlp | ||
# Make the user </code>xlp</code>, possess <code>admin</code> rights. | # Make the user </code>xlp</code>, possess <code>admin</code> rights. | ||
Line 16: | Line 26: | ||
# Then run some <code>sudo</code> command | # Then run some <code>sudo</code> command | ||
sudo ls -l /etc/ | sudo ls -l /etc/ | ||
If the the above worked, you have created an administrative account with user name:<code> | If the the above worked, you have created an administrative account with user name:<code>xlp</code>. | ||
<noinclude> | |||
=References= | =References= | ||
[[Category:Account]] | |||
</noinclude> |
Latest revision as of 03:10, 23 August 2021
All accounts on MediaWiki are registered in the relational database (MySQL). Due to this design, in case you lost the admin password, which is the first user of the MediaWiki system, you must go to the database and change the password using SQL. Detailed instructions here: (Sample code is shown as follows)
UPDATE user SET user_password = MD5( CONCAT( user_id, '-', MD5( 'NEWPASS' ) ) ) WHERE user_id =1;
Otherwise, one can use the changePassword.php maintenance script. Just launch the following command in a terminal (command line interface) application.
php changePassword.php --user=target_username --password=new_password
For detailed instructions, one can refer to MediaWiki's Manual:Resetting passwords.
The following instruction steps are inspired by the article[1]:
Operating System Accounts
To add a new user account with administrator access, one must follow these steps:
- Log in to the system with root access, using a terminal applications.
- Create a new user name, say xlp, by using the
adduser
command:
adduser xlp
- Make the user xlp, possess
admin
rights.
usermod -aG sudo xlp
- Verify its rights using
id xlp
- Log in as
xlp
, by key in the following command
su - xlp
- Then run some
sudo
command
sudo ls -l /etc/
If the the above worked, you have created an administrative account with user name:xlp
.