Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

SSH question

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


relson at osagesoftware

Aug 19, 2012, 8:31 PM

Post #1 of 6 (176 views)
Permalink
SSH question

G'day,

I've volunteered to do some data entry for my local bike club. This
involves a java application (jar file) and a tunnel to a mysql
server. I have detailed PuTTY configuration instructions but haven't
yet succeeded in converting them to ssh options.

The configuration options include:

Seconds between keepalives -- 120
Don't start a shell or command
Forwarded port:
source port number - PORT
Destionation: MACHINE.DOMAIN.COM
Host - IP_Address
Login - userid
Password - pw

Using "ssh -N userid [at] IP_Addres" gives me a password prompt and no
command prompt - both good.

How do I specify the forwarded port?

Thank you.

David


caneko at gmail

Aug 19, 2012, 8:48 PM

Post #2 of 6 (168 views)
Permalink
Re: SSH question [In reply to]

On Sun, Aug 19, 2012 at 10:31 PM, David Relson <relson [at] osagesoftware> wrote:
> G'day,
>
> I've volunteered to do some data entry for my local bike club. This
> involves a java application (jar file) and a tunnel to a mysql
> server. I have detailed PuTTY configuration instructions but haven't
> yet succeeded in converting them to ssh options.
>
> The configuration options include:
>
> Seconds between keepalives -- 120
> Don't start a shell or command
> Forwarded port:
> source port number - PORT
> Destionation: MACHINE.DOMAIN.COM
> Host - IP_Address
> Login - userid
> Password - pw
>
> Using "ssh -N userid [at] IP_Addres" gives me a password prompt and no
> command prompt - both good.
>
> How do I specify the forwarded port?

If I understand correctly, with -L:

ssh -L XX:machine2:YY user [at] machine

This command will connect you to the "machine1" host with user "user",
and any connection to the port XX to the machine you are running the
ssh command from, will redirect the connection to the "machine2" host
in the YY port.

Regards.
--
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México


michaelkintzios at gmail

Aug 19, 2012, 10:50 PM

Post #3 of 6 (164 views)
Permalink
Re: SSH question [In reply to]

On Monday 20 Aug 2012 04:48:40 Canek Peláez Valdés wrote:
> On Sun, Aug 19, 2012 at 10:31 PM, David Relson <relson [at] osagesoftware>
wrote:
> > G'day,
> >
> > I've volunteered to do some data entry for my local bike club. This
> > involves a java application (jar file) and a tunnel to a mysql
> > server. I have detailed PuTTY configuration instructions but haven't
> > yet succeeded in converting them to ssh options.
> >
> > The configuration options include:
> > Seconds between keepalives -- 120
> > Don't start a shell or command
> >
> > Forwarded port:
> > source port number - PORT
> > Destionation: MACHINE.DOMAIN.COM
> >
> > Host - IP_Address
> > Login - userid
> > Password - pw
> >
> > Using "ssh -N userid [at] IP_Addres" gives me a password prompt and no
> > command prompt - both good.
> >
> > How do I specify the forwarded port?
>
> If I understand correctly, with -L:
>
> ssh -L XX:machine2:YY user [at] machine
>
> This command will connect you to the "machine1" host with user "user",
> and any connection to the port XX to the machine you are running the
> ssh command from, will redirect the connection to the "machine2" host
> in the YY port.

If you want to forward a local port XX to a remote port YY then Canek's
suggestion will do what you want, assuming that the correct remote application
is listening on port YY.

When you have more than one application this can soon become tedious. So, if
you want to set up the remote machine as a SOCKS proxy so that any socks-ified
applications on the local machine can connect to the remote SOCKS, then you
can use:

ssh -N -D XXXX user [at] machine

For applications that do not have built in proxy capability you can use e.g.
proxychains.

HTH.
--
Regards,
Mick
Attachments: signature.asc (0.19 KB)


relson at osagesoftware

Aug 20, 2012, 4:35 AM

Post #4 of 6 (160 views)
Permalink
Re: SSH question [In reply to]

On Mon, 20 Aug 2012 06:50:29 +0100
Mick wrote:

> On Monday 20 Aug 2012 04:48:40 Canek Peláez Valdés wrote:
> > On Sun, Aug 19, 2012 at 10:31 PM, David Relson
> > <relson [at] osagesoftware>
> wrote:
> > > G'day,
> > >
> > > I've volunteered to do some data entry for my local bike club.
> > > This involves a java application (jar file) and a tunnel to a
> > > mysql server. I have detailed PuTTY configuration instructions
> > > but haven't yet succeeded in converting them to ssh options.
> > >
> > > The configuration options include:
> > > Seconds between keepalives -- 120
> > > Don't start a shell or command
> > >
> > > Forwarded port:
> > > source port number - PORT
> > > Destionation: MACHINE.DOMAIN.COM
> > >
> > > Host - IP_Address
> > > Login - userid
> > > Password - pw
> > >
> > > Using "ssh -N userid [at] IP_Addres" gives me a password prompt and no
> > > command prompt - both good.
> > >
> > > How do I specify the forwarded port?
> >
> > If I understand correctly, with -L:
> >
> > ssh -L XX:machine2:YY user [at] machine
> >
> > This command will connect you to the "machine1" host with user
> > "user", and any connection to the port XX to the machine you are
> > running the ssh command from, will redirect the connection to the
> > "machine2" host in the YY port.
>
> If you want to forward a local port XX to a remote port YY then
> Canek's suggestion will do what you want, assuming that the correct
> remote application is listening on port YY.
>
> When you have more than one application this can soon become
> tedious. So, if you want to set up the remote machine as a SOCKS
> proxy so that any socks-ified applications on the local machine can
> connect to the remote SOCKS, then you can use:
>
> ssh -N -D XXXX user [at] machine
>
> For applications that do not have built in proxy capability you can
> use e.g. proxychains.
>
> HTH.
> --
> Regards,
> Mick

H'lo Mick and Carnek,

The mention of XX and YY wasn't transparent, but a bit of
experimentation gave a good connection. Using the terms in my original
post, I now have the following working command:

ssh -2 -N -L PORT:MACHINE.DOMAIN.COM:22 userid [at] IP_Addres

Just need to add an appropriate TCPKeepAlive and all will be good.

Thank you both for your tips..

Regards,
David


michaelkintzios at gmail

Aug 20, 2012, 11:04 AM

Post #5 of 6 (161 views)
Permalink
Re: SSH question [In reply to]

On Monday 20 Aug 2012 12:35:06 David Relson wrote:
> On Mon, 20 Aug 2012 06:50:29 +0100
>
> Mick wrote:
> > On Monday 20 Aug 2012 04:48:40 Canek Peláez Valdés wrote:
> > > On Sun, Aug 19, 2012 at 10:31 PM, David Relson
> > > <relson [at] osagesoftware>
> >
> > wrote:
> > > > G'day,
> > > >
> > > > I've volunteered to do some data entry for my local bike club.
> > > > This involves a java application (jar file) and a tunnel to a
> > > > mysql server. I have detailed PuTTY configuration instructions
> > > > but haven't yet succeeded in converting them to ssh options.
> > > >
> > > > The configuration options include:
> > > > Seconds between keepalives -- 120
> > > > Don't start a shell or command
> > > >
> > > > Forwarded port:
> > > > source port number - PORT
> > > > Destionation: MACHINE.DOMAIN.COM
> > > >
> > > > Host - IP_Address
> > > > Login - userid
> > > > Password - pw
> > > >
> > > > Using "ssh -N userid [at] IP_Addres" gives me a password prompt and no
> > > > command prompt - both good.
> > > >
> > > > How do I specify the forwarded port?
> > >
> > > If I understand correctly, with -L:
> > >
> > > ssh -L XX:machine2:YY user [at] machine
> > >
> > > This command will connect you to the "machine1" host with user
> > > "user", and any connection to the port XX to the machine you are
> > > running the ssh command from, will redirect the connection to the
> > > "machine2" host in the YY port.
> >
> > If you want to forward a local port XX to a remote port YY then
> > Canek's suggestion will do what you want, assuming that the correct
> > remote application is listening on port YY.
> >
> > When you have more than one application this can soon become
> > tedious. So, if you want to set up the remote machine as a SOCKS
> > proxy so that any socks-ified applications on the local machine can
> >
> > connect to the remote SOCKS, then you can use:
> > ssh -N -D XXXX user [at] machine
> >
> > For applications that do not have built in proxy capability you can
> > use e.g. proxychains.
> >
> > HTH.
>
> H'lo Mick and Carnek,
>
> The mention of XX and YY wasn't transparent, but a bit of
> experimentation gave a good connection. Using the terms in my original
> post, I now have the following working command:
>
> ssh -2 -N -L PORT:MACHINE.DOMAIN.COM:22 userid [at] IP_Addres
>
> Just need to add an appropriate TCPKeepAlive and all will be good.
>
> Thank you both for your tips..

You're welcome. BTW, port 22 in your example above does not *have* to be port
22. As a matter of fact if it isn't, it would avoid zillions of connection
attempts by stupid botnets that could drive up your bandwidth consumption. It
could also be the same port as the one you use at your local host. Whichever
port you choose, you'll have to allow it through the firewall at the remote
machine and of course whichever application is running at the remote host that
you want to connect to, should be listening on said port.
--
Regards,
Mick
Attachments: signature.asc (0.19 KB)


relson at osagesoftware

Aug 22, 2012, 5:02 PM

Post #6 of 6 (157 views)
Permalink
Re: SSH question [In reply to]

On Mon, 20 Aug 2012 19:04:38 +0100
Mick wrote:

...[snip]...

> You're welcome. BTW, port 22 in your example above does not *have*
> to be port 22. As a matter of fact if it isn't, it would avoid
> zillions of connection attempts by stupid botnets that could drive up
> your bandwidth consumption. It could also be the same port as the one
> you use at your local host. Whichever port you choose, you'll have to
> allow it through the firewall at the remote machine and of course
> whichever application is running at the remote host that you want to
> connect to, should be listening on said port. --
> Regards,
> Mick

The remote machine(s) were set up by someone else.

My firewall deals with port 22 by periodically checking for multiple
failed logins from the same IP address and then blocking that address.
The list gets long, but with the automatic handling, it's not a
problem :->

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.