Create new home directory for a user in Ubuntu

1

A quick question on user management in Ubuntu 10.04.

I encounter the following practice in some deployment script for web server:

mkdir /home/www-data
cd /home/www-data
wget http://somesite.com/static/some_package.zip
unzip some_package.zip
rm some_package.zip
chown -R www-data:www-data some_package

It seems to me that no user/group has been explicitly created as 'www-data', unless the chown command does that? If so, does that mean that I can run stuff inside /home/www-data/ as user 'www-data' in some server start-up script? Or do I need to do extra permission configurations?

MLister

Posted 2012-06-17T15:53:56.173

Reputation: 165

Answers

0

On Debian-based systems, the user and group www-data are usually created at installation time, for use by web servers.

If they didn't exist, chown wouldn't create them – it would display an error message instead.

user1686

Posted 2012-06-17T15:53:56.173

Reputation: 283 655

thanks for the clarification. one more thing, do I need to use chown to change the ownership of every time I copy a package/folder to /home/www-data/ when I deploy? – MLister – 2012-06-17T17:55:12.653