Proxy

Requirements

You need PC or server with Linux and public IPv4 address. You may have to redirect port 22 from your router to your PC if you use the router and NAT.

Installation of proxy on your own Linux PC

Download HaaS proxy

Required dependencies:

Installation from PyPI

sudo pip[3] install haas-proxy
sudo apt-get install sshpass

Installation from Python package

tar -xzf haas-proxy-1.0.tar.gz
sudo python[3] haas-proxy-1.0/setup.py install
sudo apt-get install sshpass

Installation on Linux with deb packages

sudo dpkg -i python[3]-haas-proxy_1.0_all.deb
sudo apt-get install -f

Installation on Linux with rpm packages

sudo dnf install python[3]-haas-proxy-1.0-1.noarch.rpm

Run the proxy

python[3] -m haas_proxy -l /dev/null --pidfile /var/run/haas.pid haas_proxy -l /var/log/haas.log --log-level warning --device-token XXX

Generally it is Twisted app so there are options for Twisted and also for our HaaS. Passing --help on place of twisted options returns help for the twistd command, on place of HaaS options it returns help for the HaaS.

python[3] -m haas_proxy [TWISTED OPTIONS] haas_proxy [HAAS OPTIONS]

Download and run proxy from Docker Hub

docker run -d -p=2222:2222 -e DEVICE_TOKEN=XXX cznic/haas-proxy

Configuring the router and the PC behind NAT

You need to run proxy on your PC and you must redirect port 22 to your PC on the router. Proxy by default runs on port 2222. Usually you will redirect 22 from the router to 2222 on your PC (to the proxy) and some other public port to 22 on your PC.

Use case with NAT and redirected port 22

Installation on Turris and Turris Omnia

If you want to use HaaS with your Turris, just enable SSH honeypot in Updater tab in the administration interface called Foris. Everything else will work automatically and you will be able to use the same login as for Project Turris.

Documentation in Turris