Can't sign in after server move

Re: Can't sign in after server move

by Otaku Dude -
Number of replies: 10
Hello Ken,

Thanks again! I have IT popping over to check tomorrow. Hopefully that will resolve some issues! In the meantime i'll give that sos a go smile

Thanks,

Nige.
In reply to Otaku Dude

Re: Can't sign in after server move

by Otaku Dude -
Hi all!

Sorry for the delay in returning to this thread.

I have now managed to get admin access to all Moodles by setting up admin id 2 correctly in the database via MySql Workbook. I then set my 2 colleagues and myself up and ensured that we were all manual auth and siteadmins. Interestingly, we don't all have access to the 4 Moodles, some can log in, some can't. For set the config.php to .....auth='manual'; but it makes no difference for those who couldn't log in. I no longer get LDAP errors, just 'Invalid Login, please try again'. I assume the password stored in Moodle is the one that LDAP would use too?

Ken - the cli was resolved after many hours of googling! It was clear that cli wasn't installed but all the yum install commands didn't seem to work until I tried 'yum install php72u-cli'

So now I can attack the issue from both ends. Is there anything obvious that need to change in the LDAP Moodle settings or configs when moving/archiving a Moodle install?

Many thanks again,

Nige.
In reply to Otaku Dude

Re: Can't sign in after server move

by Ken Task -
Picture of Particularly helpful Moodlers

php72u indicates your serve is using IUS repo ... https://ius.io/ for PHP.

yum repolist will show what repos you server will acquire updates from.

https://dl.iuscommunity.org/pub/ius/stable/CentOS/7/x86_64/repoview/

Why it's important you know that ... repos can provide an update that you don't want ... just yet.  Moodle code has not been tested with all latest/greatest yet ... like MySQL vr 8.

On your server it might be wise not to allow those repos to autoupdate.   Set of that beyond the scope of Moodle forums but do suggest you investigate your servers yum and repo setups.


"... the password stored in Moodle is the one that LDAP would use too?"

normally, remote authentications in moodle do NOT store password in moodle mdl_user tables or other authentication tables.  I use Google Oauth2 on several servers and I would not want Moodle to store password in moodle.

"Is there anything obvious that need to change in the LDAP Moodle settings or configs when moving/archiving a Moodle install?"

Networking comes before application ... so if LDAP server is protected by some setting as to what internet servers can access/use it for authentication, then your new moodle (new IP) may not be in an allowed list ... something like that.  LDAP/AD changes so a change to LDAP/AD might/would affect moodle's use of it.  LDAP/AD admins might make a change that inadvertently affects Moodle.  So make sure your LDAP/AD server admin is aware.

'SoS', Ken


Average of ratings: Useful (1)
In reply to Otaku Dude

Re: Can't sign in after server move

by Ken Task -
Picture of Particularly helpful Moodlers

Couple of more thought ... if you didn't have php72u-cli installed what about php72u-ldap?

The only reason for setting authentications via config.php was to get around issues with LDAP.   Comment out that line in config.php.  After that, whatever authentications are enabled come into play again.

LDAP authentications enabled? 

There is a CLI script in moodlecode/admin/cli/ called cfg.php.

Execute like : php cfg.php (now that you have CLI).

Look for settings related to authentications.

php cfg.php |grep auth

Your getting closer to resolution now! smile

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Can't sign in after server move

by Otaku Dude -
Hiya Ken,

Thank you once more....

OK, so I spoke to IT and they told me that there should be no restriction on LDAP connections.

I have started to compare the archive to last years archive. When i do yum list installed I find that there is an extra package on the previous server 'openldap-clients.x86_64' Do I need this installed, will 'yum install openldap-clients' be enough?

Also, I did a variation of your '.......grep auth', and switched it to 'grep ldap'. On the previous archive it gave me auth ldap,email,mnet (and a few LDAP things) - on the current one it didn't return anything. Is it looking like LDAP has not been properly set up on the server?

Is there a way to test LDAP is working? I googled and found ldapsearch but it looked a bit complicated ;) 

Thank you,

Nigel.
In reply to Otaku Dude

Re: Can't sign in after server move

by Ken Task -
Picture of Particularly helpful Moodlers

Network techs have been known to be wrong ... not intentionally ... so my advice is to test yourself using nmap.

nmap -P0 -p LDAPPORT IPADDRESSOFLDAPserver.

A real one:

nmap -P0 -p 389 172.25.84.30

would show:

389/tcp open  ldap

Means moodle server can talk to ldap on port 389 ... open.

On a server using LDAP for students only I do have openldap.x86_64 and openldap-clients.x86_64 installed even though Moodle doesn't really need it.  Comes into play testing however.

Are you using Moodle Networking?  That's the mnet in your auth ... shows it's turned on ... if not using, turn it off.

Yep, that ldapsearch command is 'involved' and not really a user friendly tool ... unless you are into LDAP.   Am not myself.

For 'easier' testing and admin of a server I usually install Webmin - open sourced cPanel.   It has it's own perl based web service one runs on ports like 100000 and a web based LDAP search that allows one to view the tree/forest/OU's etc. but not edit them - which is all you need for Moodle.

https://doxfer.webmin.com/Webmin/LDAP_Client

You do have to set that up to talk to an LDAP server with a user that can query the tree/forest whatever.

Once you do that successfully - which would have same settings one would use in Moodle for the BIND user, one can drill down via it's LDAP Browser into LDAP to find the OU's that contain users ... internet Schema ... which is the stuff moodle uses.

Can't share a screen shot as that would disclose too much info.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Can't sign in after server move

by Otaku Dude -
Hiya Ken,

Nmap returned 636/tcp open ldapssl so looks like moodle/ldap communication is working. In Moolde the ldap test setting return:

LDAP paged results not supported (either your PHP version lacks support, you have configured Moodle to use LDAP protocol version 2 or Moodle cannot contact your LDAP server to see if paged support is available.)

Thanks,

Nige.
In reply to Otaku Dude

Re: Can't sign in after server move

by Otaku Dude -
Hiya all,

Slow progress!! OK, two of the 4 Mooldes are now working and ldap is all good. I had to install several packages and then set up ldpa with authconfig-tui

All of the Mooldes return 'Connecting to your LDAP server was successful' when I test ldap settings so it looks like the server is set up OK now. However, two of them do nor have ldap enabled and will not allow me to click the 'enable' icon in the list of Authentication methods. Nothing happens. Is this pointing to some known issue? I have checked the ldap settings in Moolde and they all seem to be identical.

Many thanks,

Nige.
In reply to Otaku Dude

Re: Can't sign in after server move

by Ken Task -
Picture of Particularly helpful Moodlers

Is there an auth line in config.php which doesn't include ldap?   If line exist, it controls what can be enabled.   Comment line out (// in front).   Then see if you can enable.

'SoS', Ken


In reply to Ken Task

Re: Can't sign in after server move

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
There was an cfg option suggested:

https://moodle.org/mod/forum/discuss.php?d=388594#p1566425

https://moodle.org/mod/forum/discuss.php?d=388594#p1567339

Suspect it hasn’t been removed after the initial problem.
Average of ratings: Useful (1)
In reply to Jon Bolton

Re: Can't sign in after server move

by Otaku Dude -
Hiya Jon,

Of course you are correct smile

I'd totally forget about that. However, it was originally added due to the 'auth_ldap/ntlmsso_iwamagicnotenabled' error. Removing the CFG returned this error, but the skip ntlmsso url trick works so I've used that url for access to the two archives with this issue. I've checked the ntlm settings within Moodle's ldap settings and it's enabled and set up the same as the other two that do work.

I just want to shout out a big thanks to everyone who's helped with this issue so far - what a great community smile

Nige.