我通过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
发布评论