[SWLUG] using ssh to talk to a server?

Mark Summerfield mark at qtrac.eu
Fri May 2 10:51:01 UTC 2008


On 2008-05-02, Justin Mitchell wrote:
> On Fri, 2008-05-02 at 10:54 +0100, Mark Summerfield wrote:
> > Hi,
> >
> > I'm trying to do this:
> >
> > Machine 192.168.1.2 (Fedora 8)
> >     run a server on port 9876
> >
> > Machine 192.168.1.3 (Kubuntu 8)
> >     talk to machine 192.168.1.2's server on port 9876.
> >
> > Both machines are running sshd.
> >
> > I've tried using ssh -R and -L but I can't get it to work and I just
> > don't understand the ssh man page. Surely this is easy to do?
>
> you dont quite say what kind of server is on port 9876
>
> if the sshd on 1.2 is listening on port 9876 then
> ssh -p 9876 192.168.1.2
>
> if this gets any kind of connection refused then your sshd isnt
> listening where you think it is. lsof or netstat can help you check what
> ports a program is listening on.
>
>
> if port 9876 is a service you wish to access from 1.3 through port
> forwarding then
>
> ssh 192.168.1.2 -L 9876:localhost:9876
>
> will make port 9876 on 1.3 connect through to 1.2 for as long as the ssh
> session remains open.

That was exactly what I needed and it worked!
(Sorry I didn't make it clear what I wanted, but I didn't realise the
difference.)

Thanks!

-- 
Mark Summerfield, Qtrac Ltd., www.qtrac.eu




More information about the Swlug mailing list