Skip to content

Commit

Permalink
Add hardened systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
svenstaro committed Mar 6, 2022
1 parent fb5124e commit 4ab9a1e
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -234,6 +234,17 @@ TF_VAR_uptermd_host_keys_dir=PATH_TO_HOST_KEYS \
bin/do-install
```

### systemd

A hardened systemd service is provided in `systemd/uptermd.service`. You can use it to easily run a
secured `uptermd` on your machine:

```
cp systemd/uptermd.service /etc/systemd/system/uptermd.service
systemctl daemon-reload
systemctl start uptermd
```

## How is Upterm compared to prior arts?

Upterm is an alternative to [Tmate](https://tmate.io).
28 changes: 28 additions & 0 deletions systemd/uptermd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Unit]
Description=upterm secure terminal sharing
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
ExecStart=/usr/bin/uptermd --ssh-addr 0.0.0.0:2222

IPAccounting=yes
IPAddressAllow=localhost
IPAddressDeny=any
DynamicUser=yes
PrivateTmp=yes
PrivateUsers=yes
PrivateDevices=yes
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=yes
ProtectClock=yes
ProtectControlGroups=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

0 comments on commit 4ab9a1e

Please sign in to comment.