通过SSH隧道访问LDAP

编程入门 行业动态 更新时间:2024-10-26 18:21:13
本文介绍了通过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

本文发布于:2023-10-07 12:40:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:隧道   SSH   LDAP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!