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-2.0.2.tar.gz
sudo python[3] haas-proxy-2.0.2/setup.py install
sudo apt-get install sshpass

Installation on Linux with deb packages

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

Installation on Linux with rpm packages

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

Run the proxy

python[3] -m haas_proxy --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]

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 the Package management tab in the web interface called reForis. Then fill the token in Honeypot as a Service tab.

Documentation in Turris