A Simple SSH-like implementation built from scratch (not entirely i indeed used cryptography and pty packages).
I also have a video recorded of me implementing this check it out: https://www.youtube.com/watch?v=mXwZXscztyw&t=2509s
This project implements a secure client-server system with:
- key exchange
- server authentication
- encrypted communication
- remote command execution
- interactive shell using PTY
- Diffie-Hellman key exchange
- Server authentication (prevents MITM)
- Encrypted communication
- Remote command execution
- Interactive shell (supports
cd,nano, etc.)
server.py - SSH server
client.py - SSH client
- Client connects to server using TCP (insecure channel)
- Handshake is performed (key exchange + authentication)
- A shared key is established
- All communication is encrypted
- Client interacts with a shell running on the server
Start the server:
python server.pyStart the client:
python client.pyYou should now be able to run commands remotely.
- This is a learning project, not production-ready
- Cryptographic primitives are used via libraries
- Designed to understand how SSH works internally
- Networking (TCP sockets)
- Cryptography basics
- Protocol design
- Process and terminal handling (PTY)