/python-home-server

TCP server written in python to serve as file sharing instance between clients and server.

Primary LanguagePythonMIT LicenseMIT

python-home-server » a simple command line home server

This python-home-server called "ultron-server" is a simple command line server. It can be used as an alternative to NAS or FTP servers. As its completely written in python, it can be easily improved and new features can be added by the user. The server itself handles files between the client and the server. All actions are symmetric encrypted with the primary key generated by the setup script. Options provided by the server are described in the help section of uc.py. Ultron-server has the possibility to serve as a package manager to install important tools the user may needs on any device. The packages will be downloaded and integrated in the system.

Setup:

1. Download the necessary files

At first fetch the files from the python-home-server repository:

git clone https://github.com/rysecx/python-home-server && cd python-home-server

2. Server setup

To setup the server on a device run the following code:

sudo python3 installation-wizard.py

The program generates the private key for the encryption and a user token for authentification. The generated user token is added to the valid-tokens.txt file where all valid users are stored in.

NOTE: The encryption key and user token have to be copied in the same directory where the installation-wizard is located! Otherwise the client setup will generate a new encryption key and user token.

You can now start the server: sudo us --a address --p port

The server creates an err_log.txt file for errors occurred during runtime and a conn_log.txt file for logging incoming connections.

3. Client setup

To setup the client on a device run the following code:

sudo python3 installation-wizard.py

You can now run the command uc -h to see all available options. By running the script for the first time the programm will guide you through the server configuration.

Run the following command to check if the authentification token is valid:

uc --auth /etc/ultron-server/token.txt

4. Additional security feature

usi.py is an optional security script. It creates integrities of the files key.txt, token.txt and valid-token.txt. Therefore it can be excluded that these files have been compromised. You can use it by the following command:

sudo python3 usi.py

5. Ultron package manager

ultron package manager can be used to download necessary tools from the server. As an example you can use the provided packages folder which has to be copied to the server directory /ultron-server/packages