You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
373 B
11 lines
373 B
#!/bin/bash
|
|
if [[ -z $1 || -z $2 ]]; then
|
|
echo "Usage: $0 USER UID"
|
|
exit 1
|
|
fi
|
|
|
|
usr=$1
|
|
uid=$2
|
|
addgroup --gid ${uid:?} ${usr:?} --system
|
|
adduser --uid ${uid:?} --ingroup ${usr:?} ${usr:?} --disabled-password --gecos "" --system --no-create-home --shell /usr/sbin/nologin --home /nonexistent
|
|
printf "[User]\nSystemAccount=true\n" > /var/lib/AccountsService/users/${usr:?}
|
|
|