12 lines
186 B
Plaintext
12 lines
186 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
u=$1
|
||
|
shift
|
||
|
|
||
|
if ! id -u "$u" > /dev/null 2>&1; then
|
||
|
echo "Invalid user: $u"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
exec setpriv --pdeathsig=keep --reuid="$u" --regid="$u" --clear-groups -- "$@"
|