Moodle Log in

Moodle Log in

by Edward Garver -
Number of replies: 1

I have a Moodle installation on Bitnami Ubuntu. Everything worked fine until someone did a cleanup in active directory and removed several OU and user accounts. When I go to log into the Moodle app I get this error, LDAP-module cannot connect to any servers: Server: 'xxx.xxx.xxx.xxx', Connection: 'Resource id #75', Bind result: ''

The last admin did not copy down the admin password correctly so I cannot access the control panel for Moodle to fix. Is there a way to change admin access with Linux so I can get into the moolde control panel?

Average of ratings: -
In reply to Edward Garver

Re: Moodle Log in

by Ken Task -
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