Moodle Log in

Re: Moodle Log in

by Ken Task -
Number of replies: 0
Picture of Particularly helpful Moodlers

The following requires ssh access as root user and mysql access (the DB user and password seen in config.php has, hopefully, sufficient access rights):

Using MySQL on server:

Change your account to authenticate manually via DB

First find the mdl_user tables ID number for your account.

Using mysql client:

mysql> select * from `mdl_user` where (`username` like "YOURUSERNAME");

Note the ID number

Then change the authentication to 'manual'.  Leaving password blank as the password
coming from LDAP probably wasn't retained in the mdl_user table.

mysql> update mdl_user set auth="manual" where id="[YOURUSERID]";

See that it has been changed:

mysql> select id,username,auth,password from mdl_user where id="[YOURUSERID]"

Quit mysql: \q [ENTER]


Then you can use the script built to reset password as root user.

cd /poathtomoodlecode/admin/cli/

php reset_password.php

== Password reset ==
enter username (manual authentication only):
[YOURUSERNAME] [ENTER]
It will then prompt for the password and you'll have to confirm it.

Open browser and login.

Now that you are in as an Admin level user, STRONGLY suggest manually creating another
account that WON'T BE KNOWN TO LDAP - thus LDAP admins can never lock you out again.
That account does NOT have to have a valid Email address cause the account will never be used for anything but 'insurance' ... username@sameFQDNasMoodleServer.  Set this account to be admin level.

'spirit of sharing', Ken