Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure Python chat with SSH - How?

I am trying to create a secure chat server with python, and after many hours of hunting all I have discovered is that I should use SSH, and that Paramiko seems to be the best python module for it (I may be wrong). I cannot find out how to implement this though, and being quite new to Python, the docs were a bit deep for me, especially as I didn't really know what to look for!

Any links to example code would be greatly appreciated, especially concerning the server (there seems to be hundreds of examples about connecting to an ssh server, but none about creating them - am i missing something vital here? I have heard that it is possible to create an ssh server in python, but the apparent lack of code on the internet is worrying me)

Thanks

EDIT:

My ultimate goal is to create a secure chat client with python, and I would like to keep it as simple as possible, however, security is the main goal. I have seen and made several chat clients in the recent past, however, they required telnet to connect to them, so were not secure, I wish to correct this.

like image 960
Utupash Avatar asked Nov 17 '12 00:11

Utupash


People also ask

Can you ssh with Python?

SSH is widely used by network administrators for managing systems and applications remotely, allowing them to log in to another computer over a network, execute commands and move files from one computer to another. In python SSH is implemented by using the python library called fabric.

How do I use SSH chat?

Start by downloading the latest version of ssh-chat from its release page and extract the tar file and move into the package directory to run it as shown. Now your team members can connect to it using the ssh command, and start chatting in a straightforward chat room via a secure shell connection.


1 Answers

Try Twisted, an asynchronous networking engine written in Python. They have a very simple example called chatserver.py. Get that running and then make it listen on SSL using a self-signed SSL certificate.

Here is another example.

like image 74
jathanism Avatar answered Oct 14 '22 16:10

jathanism