You are not logged in.

#1 2011-11-02 22:07:52

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Using SSH as a secure channel for other programs

Hi,
I'm wondering if it's possible to use an SSH connection as a generic secure channel for other programs. I want to write a server-client program where I can open up an SSH channel first and then have the server and client communicate over it. If there is some other way to communicate via a secure channel and using SSH-like users and keys that would be great too.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2011-11-02 22:19:22

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Using SSH as a secure channel for other programs

stdin <= ssh => stdout?

Offline

#3 2011-11-02 22:37:12

brenix
Member
From: California
Registered: 2008-03-05
Posts: 185

Re: Using SSH as a secure channel for other programs

Have you considered tunneling??? I've tunneled all kinds of traffic for various client-server apps..

Offline

#4 2011-11-02 22:59:31

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Using SSH as a secure channel for other programs

Tunneling looks like what I want. If the SSH tunnel is repeatedly opened and closed, does that mean that the server listening on the remote port will have to restart? Or can it keep listening on the same port as the tunnel is opened and closed?


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#5 2011-11-02 23:06:34

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Using SSH as a secure channel for other programs

Basu wrote:

Tunneling looks like what I want. If the SSH tunnel is repeatedly opened and closed, does that mean that the server listening on the remote port will have to restart? Or can it keep listening on the same port as the tunnel is opened and closed?

I guess that depends on how you implement the server, and how you want to handle multiple requests and suchlike. What is your basic idea?

Offline

#6 2011-11-02 23:25:06

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Using SSH as a secure channel for other programs

It's a simple message exchange system. The client opens up a connection to the server over the SSH tunnel. I want the server to sit a loop waiting for a connection, send the client any new messages that arrived since the last connection (I'll deal with timestamping once I have a working prototype) and receive any message the client wants to send. Ideally the server should be able to just sit in a loop and listen for new connections irrespective of whether the tunnel opens or closes.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#7 2011-11-03 03:22:10

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Using SSH as a secure channel for other programs

Basu wrote:

It's a simple message exchange system.

I've been looking into this... Best solution I've found is AMQP / RabbitMQ.
(I hate reinventing the wheel)

Offline

#8 2011-11-03 10:25:37

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Using SSH as a secure channel for other programs

fukawi2 wrote:
Basu wrote:

It's a simple message exchange system.

I've been looking into this... Best solution I've found is AMQP / RabbitMQ.
(I hate reinventing the wheel)

Well, reinventing the wheel can teach you a great deal IMO. That usally how I get to learn how stuff works wink

Offline

#9 2011-11-03 14:15:11

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Using SSH as a secure channel for other programs

Yeah this is mainly a personal project to learn more networking stuff, so I'm going to try to do this "by hand" and see what happens.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

Board footer

Powered by FluxBB