From 363bf5735ed81e68839842e94d06e7c0eca14961 Mon Sep 17 00:00:00 2001 From: Zhengjun Zhang Date: Sun, 1 Jan 2017 00:41:33 +0800 Subject: [PATCH] Add capabilities for Debian Linux, so you can run ss-* as non-root. --- debian/control | 2 ++ debian/shadowsocks-libev.postinst | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/debian/control b/debian/control index a47e6d28..aa90e2d2 100644 --- a/debian/control +++ b/debian/control @@ -69,6 +69,8 @@ Depends: apg, ${misc:Depends}, ${shlibs:Depends}, +Suggests: + libcap2-bin Description: lightweight and secure socks5 proxy Shadowsocks-libev is a lightweight and secure socks5 proxy for embedded devices and low end boxes. diff --git a/debian/shadowsocks-libev.postinst b/debian/shadowsocks-libev.postinst index 58451ed8..a96cfad2 100755 --- a/debian/shadowsocks-libev.postinst +++ b/debian/shadowsocks-libev.postinst @@ -2,6 +2,13 @@ set -e +if [ -f /sbin/setcap ]; then + setcap cap_net_bind_service+ep /usr/bin/ss-local 2>/dev/null + setcap cap_net_bind_service+ep /usr/bin/ss-server 2>/dev/null + setcap cap_net_bind_service+ep /usr/bin/ss-tunnel 2>/dev/null + setcap cap_net_bind_service+ep /usr/bin/ss-redir 2>/dev/null +fi + case "$1" in configure|reconfigure) if [ ! -f /etc/shadowsocks-libev/config.json ]; then