通过 SSH 隧道访问 LDAP

编程入门 行业动态 更新时间:2024-10-27 06:24:31
本文介绍了通过 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:38:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469403.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:隧道   SSH   LDAP

发布评论

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

>www.elefans.com

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