PHP connect via SSH tunnel to LDAP in other network -


i'm developing website school. in school authenticate users via ldap, there idea same via school-site. on site working perfectly, during developing need test if such solution works, of not. in order not commit changes want test site on local computer, connecting ldap want use ssh tunnel. in school network have 1 server through witch connecting inside of our school network. it's address phoenix.lo5.bielsko.pl. inside network have ldap server opened 389 , 636 ports. it's address auth.lo5. don't have access auth.lo5 via ssh, can connect ldap entries. so, i've tried run ssh tunnel running:

ssh -l 636:auth.lo5:636 hfaua@phoenix.lo5.bielsko.pl 

then, i've set in /etc/hosts auth.lo5 pointing 127.0.0.1. i'm connecting ldap in php in such way:

ldap_connect('ldaps://auth.lo5', 636); 

but i'm getting error can't contact ldap server. think, problem might on phoenix.lo5.bielsko.pl in ssh daemon config or in arguments passed ldap_connect() function. can tell me, should set in sshd_config or in arguments passed ldap_connect working?

i posted same question in similar thread, no 1 has answered question.

p.s. in /etc/ssh/sshd_config have line allowtcpforwarding yes

if got right phoenix.lo5 , auth.lo5 2 different machines. if have create tunnel ssh machine, , send ldap queries right machine.

your command: ssh -l 636:auth.lo5:636 hfaua@phoenix.lo5.bielsko.pl right if phoenix.lo5.bielsko.pl can resolve auth.lo5 via dns or /etc/hosts, if not need use internal ip address.

also if want use port 636 on pc, need run command superuser (root or sudo) else need use high port (above 1024) stated borealid

once tunnel have point localhost queries


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -