Open a ssh tunnel on particular port


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Open a ssh tunnel on particular port
# 1  
Old 08-11-2015
Open a ssh tunnel on particular port

Hello Community,

We have Installed a LDAP Directory behind a Firewall with redirectory port on an Ubuntu virtual machine. The virtual machine is installed on an Ubuntu physical server, that hosts many other virtual machine. All the virtual machine are only joinable from the intern network.
My Problem:
I want to connect on the virtual machine on a special port, were LDAP is installed. I do this:
First step: I connect me through ssh on the physical host
(ssh padressephysicalhost).
Second step: I try to open a tunnel on the virtual guest with following parameter:
Source port: 3391
Destination: 389
Ip Guest: 192.168.10.10
Which ssh parameter have I to use?

Thanks
Best regards
# 2  
Old 08-11-2015
If I understand correctly:

Code:
ssh -L 3391:192.168.10.10:389 user@padressephysicalhost

# 3  
Old 08-12-2015
Thanks you firstly for your answer.
You correctly understand, but I can connect through ssh on the Physical host (the root Server). Now, that I am on it, I want to open a tunnel on the Guest on the port 389.
I tried
Code:
ssh -L 3391:192.168.10.10:389

and here ist he result:

Code:
  usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
             [-D [bind_address:]port] [-e escape_char] [-F configfile]
             [-I pkcs11] [-i identity_file]
             [-L [bind_address:]port:host:hostport]
             [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
             [-R [bind_address:]port:host:hostport] [-S ctl_path]
             [-W host:port] [-w local_tun[:remote_tun]]
             [user@]hostname [command]

Although the command and the parameters are right, I become this.
I don’t know what i have to do.

Thanks
Best regards

Last edited by Corona688; 08-12-2015 at 12:33 PM..
# 4  
Old 08-12-2015
You must give these parameters when starting ssh. Thus, you need to still specify a host to connect to.

If you want to do so after the connection, you need to press [enter]~C to enter a mini command mode and type the same: -L 3391:192.168.10.10:389
# 5  
Old 08-12-2015
I tried this too and I connect only on the root server.
And what's is the mini command mode, I don't know it.
# 6  
Old 08-12-2015
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)



Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
# 7  
Old 08-12-2015
You -> Ubuntu Host -> LDAP server ?

You are connecting to the ubuntu host and giving the ldap server address in the -L command? Like this?
Code:
$ ssh -L 3391:ldap-server:389 ubuntu-host

Then on your own machine you can connect to localhost:3391 to access LDAP.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Tunnel using SSH

I am not clear with the part of concept of Tunneling using ssh. ssh -f -N -L 1029 192.168.1.47:25 james@192.168.1.47 I found out that above code works for me . but didn't quite well understood how ti works and need to ask you guys some questions. since we are using tunnel through ssh ... (2 Replies)
Discussion started by: lobsang
2 Replies

2. Solaris

Tunnel X over ssh for 11.3

Hello Solaris experts: Trying to bring the 11.3 gdm screen over ssh to a Linux Box: I did the following: 1. made chanes to /etc/ssh/sshd_config & bounced ssh daemon: # X11 tunneling options X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes 2. From the remote Linux box: ... (6 Replies)
Discussion started by: delphys
6 Replies

3. Proxy Server

WebSocket over SSH tunnel - is it possible?

Hello, I have a video streaming application that utilizes a WebSocket for the server <-> client communication. My goal is to make the video streaming service available over the internet in the cases where neither the server nor client have public IPs. One way to do this is over a VPN... (8 Replies)
Discussion started by: Vladislav
8 Replies

4. IP Networking

Help with SSH tunnel?

I have a Java web app on machine (X) that needs to talk to an LDAP server (Y) on :636, but the LDAP server is only accessible on a particular network. I can login to a machine (Z) on that network from X, and this machine can talk to the LDAP server on :636. How can I tunnel so that X can... (2 Replies)
Discussion started by: spacegoose
2 Replies

5. UNIX for Dummies Questions & Answers

SSH tunnel working for ssh but not for sshfs

I'm trying to setup a link between my home pc (work-machine) and a server at work (tar-machine) that is behind a gateway (hop-machine) and not directly accessible. my actions: work-machine$ ssh -L 1234:tar-machine:22 hop-machine work-machine$ ssh -p 1234 user@127.0.0.1 - shh access on... (1 Reply)
Discussion started by: Vathau
1 Replies

6. UNIX for Advanced & Expert Users

Stopping SSH tunnel

I have initiated a tunnel for vncserver. now i want to stop it. is there any way except sleep option? (2 Replies)
Discussion started by: majid.merkava
2 Replies

7. UNIX for Advanced & Expert Users

ssh decipher a tunnel

Two question here, but it's only one on the protocol point of view. If two persons use the same key to connect to a SSH server is there a risk they can decipher the other tunnel. In other terms is that less safe than if they have two separate keys. Same question if two persons use the same user... (2 Replies)
Discussion started by: moi
2 Replies

8. OS X (Apple)

open ssh port (22) to connect to other box

Hi Do I have to open my ssh port if I like to connect to another machine? - if yes, how? Or is that only if I want to access my one computer from the outside? I run Mac OS 10.4 and like to access a unix box on the other side. /andreas (1 Reply)
Discussion started by: lulle
1 Replies

9. Programming

using a ssh tunnel with nx compression

hi everybody and thank you for this wondefrul forum this is my first thread posted here and i hope that i could find some help from your part (i am even sure) :D here is the situation: i am to develop an application of remote desktop access such as vnc, vpn and especially nx i want to develop... (0 Replies)
Discussion started by: bolboln01
0 Replies

10. Solaris

How to open SSH port on firewall?

Hi, So that potential responders will have an idea of what they're dealing with let me say that while I am a UNIX newbie I have been in IT for over 10 years. We have several SUN boxes running ver 5 of the OS that have been sitting dormant for some time as they were part of a now defunct... (3 Replies)
Discussion started by: pjewett
3 Replies
Login or Register to Ask a Question