This is a mini SSH-like tool for learning and testing purposes only. It includes a client and a server written in Python.
Warning: This is only for testing on your own machines. Do not expose to the public internet or run on important servers.
server.py– the server program that listens for connections and executes commandssshh– the client program that connects to a server and allows sending commands
- Make sure Python 3 is installed:
python3 --version- Run the server:
python3 server.pyThe server will start listening on port 2222 (default). You should see:
Listening on port 2222...
-
Keep the server running while clients connect.
-
Optionally, if using a cloud server (AWS, Lightsail, etc.), open TCP port 2222 in the firewall.
- Make sure Python 3 is installed:
python3 --version- Make the client executable:
chmod +x sshh- Move it to a directory in your PATH to run easily (optional):
sudo mv sshh /usr/local/bin/sshh- Connect to the server:
sshh <user>@<server-ip>Example:
sshh ubuntu@192.168.1.10-
Type commands in the client. The server will execute them and return the output.
-
To exit, type:
exit
Client:
$ sshh ubuntu@192.168.1.10
Connected to 192.168.1.10:2222
192.168.1.10> ls
projects
server.py
192.168.1.10> whoami
ubuntu
192.168.1.10> exit
Connection closed
Server Output:
Listening on port 2222...
Connected from ('192.168.1.2', 54321)
Client command: ls
Client command: whoami
Client command: exit
Connection closed
- This mini SSH is for testing and learning purposes only.
- Do not run as root or on production servers.
- Commands are executed with the privileges of the server user running the program.
- Works best on a private network or a VM.
- Add multiple client support using threads
- Add a whitelist of allowed commands for safety
- Add authentication with passwords or keys
- Customize the client with banners or colors