Skip to main content
Space, typo.
Source Link
Stephen Kitt
  • 483k
  • 60
  • 1.2k
  • 1.4k

On RedHatRed Hat distributions and derivatesderivatives, typically the package installer has a "create user" command inside the pre-install script. So, on CentOS 7, via the rpm -q --scripts httpd we can see

preinstall scriptlet (using /bin/sh): # Add the "apache" group and user /usr/sbin/groupadd -g 48 -r apache 2> /dev/null || : /usr/sbin/useradd -c "Apache" -u 48 -g apache \ -s /sbin/nologin -r -d /usr/share/httpd apache 2> /dev/null || : 

This tells us a number of things:

  • On RedHatRed Hat and derivatesderivatives the user is called apache
  • It also tries to create a group called apache
  • It wants the userid and groupid to be 48
  • But if the user or group already exist then it continues with the install.

On RedHat and derivates, typically the package installer has a "create user" command inside the pre-install script. So, on CentOS 7, via the rpm -q --scripts httpd we can see

preinstall scriptlet (using /bin/sh): # Add the "apache" group and user /usr/sbin/groupadd -g 48 -r apache 2> /dev/null || : /usr/sbin/useradd -c "Apache" -u 48 -g apache \ -s /sbin/nologin -r -d /usr/share/httpd apache 2> /dev/null || : 

This tells us a number of things:

  • On RedHat and derivates the user is called apache
  • It also tries to create a group called apache
  • It wants the userid and groupid to be 48
  • But if the user or group already exist then it continues with the install.

On Red Hat distributions and derivatives, typically the package installer has a "create user" command inside the pre-install script. So, on CentOS 7, via the rpm -q --scripts httpd we can see

preinstall scriptlet (using /bin/sh): # Add the "apache" group and user /usr/sbin/groupadd -g 48 -r apache 2> /dev/null || : /usr/sbin/useradd -c "Apache" -u 48 -g apache \ -s /sbin/nologin -r -d /usr/share/httpd apache 2> /dev/null || : 

This tells us a number of things:

  • On Red Hat and derivatives the user is called apache
  • It also tries to create a group called apache
  • It wants the userid and groupid to be 48
  • But if the user or group already exist then it continues with the install.
Source Link
Stephen Harris
  • 49.5k
  • 7
  • 115
  • 138

On RedHat and derivates, typically the package installer has a "create user" command inside the pre-install script. So, on CentOS 7, via the rpm -q --scripts httpd we can see

preinstall scriptlet (using /bin/sh): # Add the "apache" group and user /usr/sbin/groupadd -g 48 -r apache 2> /dev/null || : /usr/sbin/useradd -c "Apache" -u 48 -g apache \ -s /sbin/nologin -r -d /usr/share/httpd apache 2> /dev/null || : 

This tells us a number of things:

  • On RedHat and derivates the user is called apache
  • It also tries to create a group called apache
  • It wants the userid and groupid to be 48
  • But if the user or group already exist then it continues with the install.