Add system user to CentOS 6
I need help adding a system user to my CentOS server. I have two commands that works on Ubuntu Server, however I have to find a replacement for CentOS while keeping the same result. The commands are:
sudo adduser --system --shell /bin/sh --gecos 'Git Version Control' --group --disabled-password --home /home/git git
sudo adduser --disabled-login --gecos 'GitLab' gitlab
The options that I can't find on CentOS are --system, --disabled-password and --disabled-login.
You want to take a look at man useradd
. You seem to have a good grasp of what you want to do but adduser
= useradd
in RHEL/CentOS.
-
-r
=--system
- For the other options, I think you just want to lock the account with
passwd -l <username>
after the account is created.
Make sure empty passwords are not allowed by PAM;
Look in /etc/pam.d/system-auth
and /etc/pam.d/password-auth
and remove nullok
from the pam_unix.so
lines (if applicable.)
Ubuntu's adduser
& useradd