0

I'm on debian logged in as root and I am trying to set an env var for a specific user (not root). This is what I tried and didn't work:

su - nginx -c export APP_SETTINGS='production.py'

The error I got was:

No directory, logging in with HOME=/

Can anyone tell me what I should be using?

J.Zil
  • 1,123
  • 3
  • 21
  • 29

1 Answers1

2

The message is not an error, it's just the shell telling you that the nginx user has no home directory and will default to using the root directory (/). You can create and assign a home directory with the following (use /home/nginx or any directory you want to create; the usermod command will create it for you):

usermod -m -d /home/nginx nginx

Once the user has a home directory, you can set persistent environment variables in the appropriate shell file (usually ~/.bash_profile or ~/.profile) in the home directory using the same syntax you tried.

dartonw
  • 600
  • 2
  • 9