--- /dev/null
+---
+title: setcap-netbind
+homepage: https://github.com/webinstall/webi-installers/setcap-netbind/README.md
+tagline: |
+ setcap-netbind: Give a binary the ability to bind to privileged ports.
+---
+
+setcap-netbind will grant the specified program the ability to listen on
+privileged ports, such as 80 (http) and 443 (https) without root privileges or
+sudo. It seeks out the specified binary in your path and reads down symlinks to
+make usage as painless as possible.
+
+## Cheat Sheet
+
+```bash
+sudo setcap-netbind node
+```
+
+This is the same as running the full command:
+
+```bash
+sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))
+```
--- /dev/null
+#!/bin/bash
+
+{
+ set -e
+ set -u
+
+ rm -f "$HOME/.local/bin/setcap-netbind"
+ webi_download "$WEBI_HOST/packages/setcap-netbind/setcap-netbind.sh" "$HOME/.local/bin/setcap-netbind"
+ chmod a+x "$HOME/.local/bin/setcap-netbind"
+}
--- /dev/null
+#!/bin/bash
+
+{
+ set -e
+ set -u
+
+ my_bin="$1"
+ if [ -z "$(which $my_bin)" ]; then
+ echo "'$my_bin' not found"
+ exit 1
+ fi
+ my_sudo=""
+ if [ -n "$(command -v sudo)" ]; then
+ my_sudo=sudo
+ fi
+ $my_sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which $my_bin))
+}
## Cheat Sheet
> VPS Utils includes shortcut commands for some common tasks, including
-> `cap-net-bind`, 'vps-addswap', and 'myip'
+> `setcap-netbind`, 'vps-addswap', and 'myip'
-**cap-net-bind**:
+**setcap-netbind**:
-`cap-net-bind` will give the specified program the ability to listen on
+`setcap-netbind` will give the specified program the ability to listen on
privileged ports, such as 80 (http) and 443 (https) without `root` privileges or
`sudo`.
```bash
-sudo cap-net-bind node
+sudo setcap-netbind node
```
This is the same as running the full command:
+++ /dev/null
-#!/bin/bash
-
-{
- set -e
- set -u
-
- my_bin="$1"
- if [ -z "$(which $my_bin)" ]; then
- echo "'$my_bin' not found"
- exit 1
- fi
- my_sudo=""
- if [ -n "$(command -v sudo)" ]; then
- my_sudo=sudo
- fi
- $my_sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which $my_bin))
-}
--- /dev/null
+../setcap-netbind/setcap-netbind.sh
\ No newline at end of file