RPort - remote access and remote management
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Install and run an rport client

On macOS (any)

Download and create config

Open the terminal and as an unprivileged user download the binary and put it in /usr/local/bin

curl -L "https://downloads.rport.io/rport/stable/latest.php?filter=darwin_$(uname -m)" -o rport-mac.tar.gz
test -e /usr/local/bin/||sudo mkdir /usr/local/bin
sudo tar xzf rport-mac.tar.gz -C /usr/local/bin/ rport
rport --version
sudo mkdir /etc/rport
sudo tar xzf rport-mac.tar.gz -C /etc/rport rport.example.conf
sudo mv /etc/rport/rport.example.conf /etc/rport/rport.conf
sudo mkdir /private/var/log/rport
sudo chown ${USER} /private/var/log/rport/
sudo mkdir /private/var/lib/rport
sudo chown ${USER} /private/var/lib/rport

Now open the configuration file with an editor and enter your server URL, credentials, and fingerprint.

sudo vim /etc/rport/rport.conf

Or automate the above step using sed.

sudo sed -i '' "s|#*server = .*|server = \"${CONNECT_URL}\"|g" "$CONFIG_FILE"
sudo sed -i '' "s/#*auth = .*/auth = \"${CLIENT_ID}:${PASSWORD}\"/g" "$CONFIG_FILE"
sudo sed -i '' "s/#*fingerprint = .*/fingerprint = \"${FINGERPRINT}\"/g" "$CONFIG_FILE"
sudo sed -i '' "s/#*log_file = .*C.*Program Files.*/""/g" "$CONFIG_FILE"
sudo sed -i '' "s/#*log_file = /log_file = /g" "$CONFIG_FILE"

Before registering a service, test it with rport -c /etc/rport/rport.conf. You should not get any output and the new client should appear on the server.

For registering the service you have three options.

  1. You run it with your own user.
  2. You create a so-called system user on macOS, see below.
  3. You run it from the built-in deamon user account.

The third option is not recommended if you want to run scripts with sudo privileges because you would give to many rights to the daemon user. It’s better to create a dedicated user rport.

Create an rport system users

cat<<"EOF"|sudo bash
set -e
if id ${username} >/dev/null 2>&1;then
  echo "User ${username} exists"
echo "Adding system user $username with real name ${realname}"

for (( uid = 500;; --uid )) ; do
echo "."
if ! id -u $uid &>/dev/null; then
if ! dscl /Local/Default -ls Groups gid | grep -q [^0-9]$uid\$ ; then
dscl /Local/Default -create Groups/_$username
dscl /Local/Default -create Groups/_$username Password \*
dscl /Local/Default -create Groups/_$username PrimaryGroupID $uid
dscl /Local/Default -create Groups/_$username RealName "$realname"
dscl /Local/Default -create Groups/_$username RecordName _$username $username
dscl /Local/Default -create Users/_$username

dscl /Local/Default -create Users/_$username NFSHomeDirectory /private/var/lib/rport
dscl /Local/Default -create Users/_$username Password \*
dscl /Local/Default -create Users/_$username PrimaryGroupID $uid
dscl /Local/Default -create Users/_$username RealName "$realname"
dscl /Local/Default -create Users/_$username RecordName _$username $username
dscl /Local/Default -create Users/_$username UniqueID $uid
dscl /Local/Default -create Users/_$username UserShell /bin/sh
dscl /Local/Default -delete /Users/_$username AuthenticationAuthority
dscl /Local/Default -delete /Users/_$username PasswordPolicyOptions
chown rport /private/var/log/rport/

Register and run the service

sudo rport --service install --service-user <USERNAME> -c /etc/rport/rport.conf
sudo rport --service start

If you are in doubt the service has been created run sudo launchctl list|grep rport. It should list the pid on the first column to indicate rport is running.

$ sudo launchctl list|grep "rport$"
9942 0 rport

If you get an output like this, the installation of the service has succeeded but rport cannot start.

$ sudo launchctl list|grep "rport$"
- 0 rport

Missing write permissions to the log folder is most likely the reason. Open /Library/LaunchDaemons/rport.plist with an editor and use tmp as log directory for the start-up logs.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>







Now reload the service definition and check if rport starts.

sudo launchctl unload /Library/LaunchDaemons/rport.plist
sudo launchctl load /Library/LaunchDaemons/rport.plist
sudo launchctl start rport
sudo launchctl list|grep "rport$"

By default, rport starts at boot.