0

I am trying to figure out who is the web server user when using nginx? In my nginx.conf file I have a line that says the following...

user nginx;

Does this mean that nginx is the web server user? Can I freely change this?

Nebek
  • 21
  • 4
  • 1
    Why do you want to change it? – ceejayoz Aug 31 '21 at 15:00
  • Yes, tell us. It seems we have XY problem here. What is the real problem you are solving? After reading your other questions, especially this one https://serverfault.com/questions/1076166/how-to-create-a-user-and-give-it-read-permission-to-etc-shadow-file , I suspect you are going completely in wrong direction. – Nikita Kipriyanov Aug 31 '21 at 17:50
  • I was curious to know if that line can be changed or if it has to be nginx. What are the reasons it shouldn't be changed? – Nebek Aug 31 '21 at 19:16
  • This is what I am trying to solve: https://serverfault.com/questions/1076070/how-to-give-web-server-user-read-permission-to-etc-shadow-file – Nebek Aug 31 '21 at 19:17
  • I didn't really get a solution to the question above so I decided to split it up into different parts, thinking that may help. Please take a look and see if you can assist. – Nebek Aug 31 '21 at 19:19
  • @Nebek As was explained on the previous question, the proper way to do this is a) with ACLs, not changing the user and b) not to do it at all. – ceejayoz Sep 02 '21 at 13:05
  • @ceejayoz What is ACLs? – Nebek Sep 02 '21 at 14:38
  • @Nebek See the answer to your last question; someone else pointed you in the right direction, including an example command to set one. https://serverfault.com/questions/1076166/how-to-create-a-user-and-give-it-read-permission-to-etc-shadow-file – ceejayoz Sep 02 '21 at 16:26

1 Answers1

1

The user is simply nginx as you found in the configuration file. (At least in the distros that I'm usually using, which is Fedora/RedHat/CentOS/Rocky Linux)

You should be able to change the user if you need to. But that has already been answered in these questions:

Changing the user that nginx worker processes run under (Ubuntu 12.04)

How do I change the NGINX user?