分类
devops

Linux adduser

debian:10

addgroup --system --gid 101 nginx && \
adduser --system --disabled-login --ingroup nginx --no-create-home --home /nonexistent --gecos "nginx user" --shell /bin/false --uid 101 nginx

groupadd -r postgres --gid=999; \
useradd -r -g postgres --uid=999 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres;

centos:8

groupadd --system --gid 101 nginx && \
adduser --system --gid 101 --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx

alpine:3.11

addgroup -g 101 -S nginx && \
adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx


addgroup -g 70 -S postgres; \
adduser -u 70 -S -D -G postgres -H -h /var/lib/postgresql -s /bin/sh postgres;

opensuse/leap:15.1

groupadd --system --gid 101 nginx;
useradd  --system --gid 101 --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx