Score:0

Who is the web server user in nginx?

in flag

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?

vn flag
Why do you want to change it?
Nikita Kipriyanov avatar
za flag
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.
Nebek avatar
in flag
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 avatar
in flag
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 avatar
in flag
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.
vn flag
@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.
Nebek avatar
in flag
@ceejayoz What is ACLs?
vn flag
@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
Score:1
vn flag

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?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.