Quick start
Install the Procy server (rportd) on your own machine and connect a first client (rport) by hand. This page is
for self-hosting; on procy.sh the server runs for you and you start at
installing a client.
Doing it once by hand shows what happens behind the scenes. Later you’ll usually add clients with pairing from the web UI.
Download from the latest release:
- the server:
rportd_<version>_linux_x86_64.tar.gz; - the client:
tar.gzarchives for Linux, macOS and FreeBSD on many architectures, azipand anmsifor Windows, and DEB and RPM packages.
To build from source, run make build; the rport and rportd binaries appear in the current directory.
The commands below look up the latest version first:
VERSION=$(curl -fsSL https://api.github.com/repos/pohcee/procy-server/releases/latest \
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')
To see Procy work, run the server from any unprivileged account:
curl -LO "https://github.com/pohcee/procy-server/releases/download/${VERSION}/rportd_${VERSION}_linux_x86_64.tar.gz"
tar vxzf rportd_${VERSION}_linux_x86_64.tar.gz rportd
KEY=$(openssl rand -hex 18)
CLIENT_PASSWORD=$(openssl rand -hex 12)
./rportd --log-level info --data-dir /var/tmp/ --key $KEY --auth client1:$CLIENT_PASSWORD
rportd listens for clients on port 8080 and writes its fingerprint to /var/tmp/rportd-fingerprint.txt. Clients
use the fingerprint to check they are talking to your server.
On another machine, connect a client and map port 2222 of the server to port 22 of the client:
./rport --auth client1:<CLIENT_PASSWORD> --fingerprint <FINGERPRINT> <SERVER_IP>:8080 2222:22
Now ssh -p 2222 <SERVER_IP> lands on the client. Leave out the server port (./rport ... 22) and the server picks
a free one. ./rportd --help and ./rport --help list all options.
Use a machine on the public internet, ideally with a DNS name. Below it’s called procy.example.com.
Don’t run the server as root. It doesn’t need root rights, andrportdrefuses to start as root unless you setallow_root. Use an unprivileged user, usuallyrport.
curl -LO "https://github.com/pohcee/procy-server/releases/download/${VERSION}/rportd_${VERSION}_linux_x86_64.tar.gz"
sudo tar vxzf rportd_${VERSION}_linux_x86_64.tar.gz -C /usr/local/bin/ rportd
sudo useradd -d /var/lib/rport -m -U -r -s /bin/false rport
sudo mkdir /etc/rport/ /var/log/rport/
sudo chown rport /var/log/rport/
sudo tar vxzf rportd_${VERSION}_linux_x86_64.tar.gz -C /etc/rport/ rportd.example.conf
sudo cp /etc/rport/rportd.example.conf /etc/rport/rportd.conf
rportd refuses to start with the placeholders and sample values of rportd.example.conf (<YOUR_SEED>,
<YOUR_SECRET>, admin:foobaz, clientAuth1:1234). Open /etc/rport/rportd.conf and set:
key_seedin[server]: a random string the server’s key pair is derived from. Clients pin the resulting fingerprint, so keep it and never change it.- Client credentials in
[server], for exampleauth = "client1:<a strong password>". For a credential per client, see client authentication. - API credentials in
[api], for exampleauth = "admin:<a strong password>". The example config turns the API on at port 3000, andrportdwon’t start it without authentication. For several users, see API authentication.
To set key_seed from the command line:
KEY_SEED=$(openssl rand -hex 18)
sudo sed -i "s/key_seed = .*/key_seed = \"${KEY_SEED}\"/g" /etc/rport/rportd.conf
Leave jwt_secret empty: rportd generates one on the first start and saves it as rportd-jwt-secret.txt in the
data directory, so logins survive restarts.
Start the server in the foreground as the rport user:
sudo -u rport rportd -c /etc/rport/rportd.conf --log-level info
Watch the log with tail -f /var/log/rport/rportd.log, and copy the fingerprint from
/var/lib/rport/rportd-fingerprint.txt: your clients need it.
Stop rportd and register it as a service:
sudo rportd --service install --service-user rport --config /etc/rport/rportd.conf
sudo systemctl enable --now rportd
This creates /etc/systemd/system/rportd.service.
Always. Clients talk to the server over SSH inside HTTP, using the server’s ECDSA key pair. The fingerprint makes sure a client only connects to your server: without it, a man in the middle could pose as your server and take over your tunnels. Put a TLS reverse proxy in front to get SSH over HTTPS.
On the client, here client1.example.com, install the binary:
curl -LO "https://github.com/pohcee/procy-server/releases/download/${VERSION}/rport_${VERSION}_linux_x86_64.tar.gz"
sudo tar vxzf rport_${VERSION}_linux_x86_64.tar.gz -C /usr/local/bin/ rport
Forward port 2222 of procy.example.com to port 22 of the client:
rport --auth client1:<CLIENT_PASSWORD> --fingerprint <FINGERPRINT> --data-dir=/tmp \
procy.example.com:8080 2222:0.0.0.0:22
The server log shows the new tunnel. ssh -p 2222 procy.example.com now takes you to the client, even though it sits
behind a firewall.
sudo tar vxzf rport_${VERSION}_linux_x86_64.tar.gz -C /usr/local/bin/ rport
sudo useradd -d /var/lib/rport -U -m -r -s /bin/false rport
sudo mkdir /etc/rport/ /var/log/rport/
sudo chown rport /var/log/rport/
sudo tar vxzf rport_${VERSION}_linux_x86_64.tar.gz -C /etc/rport/ rport.example.conf
sudo cp /etc/rport/rport.example.conf /etc/rport/rport.conf
sudo rport --service install --service-user rport --config /etc/rport/rport.conf
Edit /etc/rport/rport.conf. A minimal configuration:
[client]
server = "procy.example.com:8080"
fingerprint = "<FINGERPRINT>"
auth = "client1:<CLIENT_PASSWORD>"
remotes = ['2222:22']
remotes sets up a permanent tunnel: port 22 of the client becomes port 2222 of the server. Leave it out to connect
without a tunnel and open tunnels on demand.
sudo systemctl enable --now rport
Download rport_<version>_windows_x86_64.zip from the
latest release and extract it to C:\Program Files\rport.
Rename rport.example.conf to rport.conf and edit it:
[client]
server = "procy.example.com:8080"
fingerprint = "<FINGERPRINT>"
auth = "client1:<CLIENT_PASSWORD>"
remotes = ['3300:3389']
This makes port 3389 (Remote Desktop) of the client available on port 3300 of the server. Test it from a command prompt with administrative rights:
cd "C:\Program Files\rport"
rport.exe -c rport.conf
If there are no errors, try a Remote Desktop connection to procy.example.com:3300. Then stop the client with
CTRL-C, and register and start it as a service:
rport.exe --service install -c rport.conf
sc start rport
The service starts on boot. To change that, run sc config rport start=disabled.
Install and run a client covers macOS and the other installers.
Both programs read the config file given with --config (or -c). The commented examples
rportd.example.conf and
rport.example.conf are in the release
archives and list every setting. Command line options and environment variables override the config file.
- Install the web UI and turn on HTTPS.
- Read how to secure the server.
- Let clients wait without a tunnel and open tunnels on demand.
- To run several servers, or several organizations on one, move to Postgres.