1 |
On Mon, 20 Aug 2012 06:50:29 +0100 |
2 |
Mick wrote: |
3 |
|
4 |
> On Monday 20 Aug 2012 04:48:40 Canek Peláez Valdés wrote: |
5 |
> > On Sun, Aug 19, 2012 at 10:31 PM, David Relson |
6 |
> > <relson@×××××××××××××.com> |
7 |
> wrote: |
8 |
> > > G'day, |
9 |
> > > |
10 |
> > > I've volunteered to do some data entry for my local bike club. |
11 |
> > > This involves a java application (jar file) and a tunnel to a |
12 |
> > > mysql server. I have detailed PuTTY configuration instructions |
13 |
> > > but haven't yet succeeded in converting them to ssh options. |
14 |
> > > |
15 |
> > > The configuration options include: |
16 |
> > > Seconds between keepalives -- 120 |
17 |
> > > Don't start a shell or command |
18 |
> > > |
19 |
> > > Forwarded port: |
20 |
> > > source port number - PORT |
21 |
> > > Destionation: MACHINE.DOMAIN.COM |
22 |
> > > |
23 |
> > > Host - IP_Address |
24 |
> > > Login - userid |
25 |
> > > Password - pw |
26 |
> > > |
27 |
> > > Using "ssh -N userid@IP_Address" gives me a password prompt and no |
28 |
> > > command prompt - both good. |
29 |
> > > |
30 |
> > > How do I specify the forwarded port? |
31 |
> > |
32 |
> > If I understand correctly, with -L: |
33 |
> > |
34 |
> > ssh -L XX:machine2:YY user@machine1 |
35 |
> > |
36 |
> > This command will connect you to the "machine1" host with user |
37 |
> > "user", and any connection to the port XX to the machine you are |
38 |
> > running the ssh command from, will redirect the connection to the |
39 |
> > "machine2" host in the YY port. |
40 |
> |
41 |
> If you want to forward a local port XX to a remote port YY then |
42 |
> Canek's suggestion will do what you want, assuming that the correct |
43 |
> remote application is listening on port YY. |
44 |
> |
45 |
> When you have more than one application this can soon become |
46 |
> tedious. So, if you want to set up the remote machine as a SOCKS |
47 |
> proxy so that any socks-ified applications on the local machine can |
48 |
> connect to the remote SOCKS, then you can use: |
49 |
> |
50 |
> ssh -N -D XXXX user@machine1 |
51 |
> |
52 |
> For applications that do not have built in proxy capability you can |
53 |
> use e.g. proxychains. |
54 |
> |
55 |
> HTH. |
56 |
> -- |
57 |
> Regards, |
58 |
> Mick |
59 |
|
60 |
H'lo Mick and Carnek, |
61 |
|
62 |
The mention of XX and YY wasn't transparent, but a bit of |
63 |
experimentation gave a good connection. Using the terms in my original |
64 |
post, I now have the following working command: |
65 |
|
66 |
ssh -2 -N -L PORT:MACHINE.DOMAIN.COM:22 userid@IP_Address |
67 |
|
68 |
Just need to add an appropriate TCPKeepAlive and all will be good. |
69 |
|
70 |
Thank you both for your tips.. |
71 |
|
72 |
Regards, |
73 |
David |