通过SSH隧道访问LDAP [英] Accessing LDAP through SSH tunnel

查看:224
本文介绍了通过SSH隧道访问LDAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过SSH(root用户访问权限)访问了客户办公室网络内部的计算机.

I got access via SSH (root access) to a Machine that's inside a network at my client's office.

我在计算机上编程一个需要集成到LDAP的PHP应用程序. LDAP服务器位于客户端网络上的另一台服务器中,并且不是可以从外部访问,但是我可以通过可以通过SSH连接的服务器来完美地访问它.

I'm programming in my computer a PHP application that needs to integrate to LDAP. The LDAP server is in another server at my client's network and not accesible from outside, however I can perfectly access it via the server I can connect to via SSH.

我的问题是:无论如何,我是否可以在计算机中建立隧道并设置端口以使用与网络中一台计算机的SSH连接将流量转发到LDAP服务器?

My question is: IS there anyway I can make a tunnel and setup a port in my computer to get the traffic forwarded to the LDAP server using my SSH connection to one of the computers on the network?

谢谢!!!!

推荐答案

是的,ssh具有用于创建隧道的"-L"选项.该选项采用3个参数,以冒号(:)分隔.本地侦听端口,远程主机,远程端口.

Yes, ssh has a "-L" option to create a tunnel. That option takes 3 parameters, separated by colons (:). Local listen port, remote host, remote port.

ssh -L 9999:ldapserver:389 user@otherhost

其中9999是将在其上创建隧道的本地端口. ldapserver:389位告诉它在另一侧将连接到的位置.

Where 9999 is the local port that the tunnel will be created on. The ldapserver:389 bit tells it where to connect to on the other side.

然后,告诉您的应用程序连接到localhost:9999(或您选择的任何端口),它将跨隧道传输.

Then, tell your application to connect to localhost:9999 (or whatever port you choose) and it will be tunneled across.

这篇关于通过SSH隧道访问LDAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆