- Created by Steffen Drya, last modified on Mar 09, 2021
- Not Reviewed
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 9 Next »
Application processes in root360 environments are run as the Unix-user www-data
. Likewise, all application files (such as the files in your apache or nginx document roots) are owned by www-data
.
To run a command as this user, use
sudo -u www-data command
As an example: to list the currently installed cronjobs on an application instance, you can use
sudo -u www-data crontab -l
Here is a more interesting example, an rsync command that copies data from <local-source-path>
to /mnt/nfs/<destination>
on a root360 natgw so that the resulting files are owned by www-data
instead of your project user <project-user>
:
rsync --rsync-path 'sudo -n -u www-data rsync' <additional-rsync-options> <local-source-path> <project-user>@<natgw-ip-destination>:/mnt/nfs/<destination>
$home of www-data
www-data does not have its own home directory. When you call commands with sudo -u www-data
, you inherit $HOME
from the calling user. In some cases you may want to manually set $HOME:
project-user $ HOME=/tmp/home; sudo -u www-data echo $HOME /tmp/home
Related tutorials
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
Related components
-
Page:
-
Page:
-
Page:
-
Page:
INTERMEDIATE
Related questions
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
- No labels