Questions tagged [www-data]

Default user under which apache web server is run on Debian-based systems.

www-data is the default user under which apache web server is run on Debian-based systems like Debian and Ubuntu.

76 questions
230
votes
4 answers

What's the best way of handling permissions for Apache 2's user www-data in /var/www?

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data. We've got two regular users & root. So when messing with files in /var/www, rather than having to... chown -R…
Gareth
  • 8,413
  • 13
  • 43
  • 44
12
votes
2 answers

Allow User 'git' to run 'git pull' as 'www-data' via sudo

I would like to allow git to run 'git pull' as user 'www-data'. As far as i understand git ALL=(www-data) git pull in /etc/sudoers should make it. Sadly i get an Syntax error for this line and visudo Syntax highlight breaks right after the "-"…
Ben
  • 123
  • 1
  • 1
  • 4
11
votes
1 answer

Chown in sudoers file : Safe or not?

Is it safe to add this command in sudoers file? mike ALL= NOPASSWD:/bin/chown -R www-data\:www-data /var/www and this is the only command that I want to run $mike@ubuntu: sudo chown -R www-data:www-data /var/www Thank you.
Mike
  • 125
  • 1
  • 1
  • 6
7
votes
1 answer

Postfix pipe always runs as nobody

The problem I would like postfix to pipe emails to a script that operates on files owned by the www-data group located under /var/www/. However, I receive error messages that indicate insufficient privileges. By letting the script run whoami, I can…
5
votes
3 answers

The 301 'www' nightmare. How do I change back?

About six months ago, I decided it would be best to put my website on the naked domain, let's just say 'example.com'. I did what all the instructions websites have told me with adding a 301 redirect from www.example.com to example.com. Now I wish…
Anthony
  • 51
  • 2
4
votes
1 answer

FTP user with home /var/www and group www-data has no write permission to /var/www

I have problems giving my FTP user who does not have sudo rights, write permission to /var/www. Question: How can I give the FTP user write permission to /var/www & subfolders only? ls -ld says: 1@1:/var/www$ ls -ld drwxrwsr-x 2 root www-data 4096…
user150637
4
votes
1 answer

Add www-data to group

I have a directory with the following details: drwxrwxr-x 6 root devs 4.0K Sep 9 14:57 project_dev Now I want www-data (Apache daemon) to have an access to this directory, so in my mind I am planning to add www-data to group devs. However I fear…
Leandro Garcia
  • 433
  • 2
  • 7
  • 15
4
votes
4 answers

Linux Web Server Permissions - Best Practices

On a privately owned server with one website, is there any reason the files/directories within /var/www can't be group owned by www-data? My understanding is that security risks with www-data having write access only arise if you have multiple…
Trent Scott
  • 949
  • 1
  • 11
  • 28
3
votes
2 answers

How can I keep one hacked website on my server from compromising the other websites?

I'm a teaching assistant in software security and running a server that is vulnerable by design. It's an nginx server, and it has 40 ports open. Each port serves a web application, and all the web applications are very vulnerable to hacking. If one…
Magnus
  • 255
  • 1
  • 2
  • 7
3
votes
2 answers

www-data security issue across multiple sites in a vps

I recently bought a VPS and learned a lot from it. I manged to create an ftp user, set it as the owner of my site's document root, add it to the www-user group, set the group as the group of the document root and give files 0775 (0664)…
3
votes
3 answers

Basic clarification about Limited FTP/sFTP users

I would like to get some clarification about the correct way to create limited users to access to my VPS user as WEBSERVER with Nginix. I'm used to NOT install FTP and access via SFTP only. It is ok for every set up? this is what I usually do from…
mattewre
  • 31
  • 4
3
votes
2 answers

apache2: start processes with other than www-data user

apache2 seem to start new processes with www-data user. How could I make it start new processes with some other user? ubuntu 11.04 by the way.
ren
  • 337
  • 1
  • 10
3
votes
2 answers

Why Apache child process runs as root?

I am running Ubuntu server 10.10 with Apache2-mpm-prefork and apache2-mod-php5, I am using: User www-data Group www-data in the configuration file, when executing ps -efH I get these lines: root 1497 1 0 09:43 ? …
dimsh
  • 31
  • 1
  • 4
3
votes
2 answers

Critical problem with www-data permission

i am using an apache webserver on debian, handling 12 different websites. Two days ago i suffered an attack and a hacker uploaded a php shell thru ftp in one of those 12 sites. What i'd though about this shell, is "bah, this only can access to the…
user61264
  • 31
  • 2
3
votes
2 answers

Is adding users to the group www-data safe on Debian?

Many PHP applications do self-configuration and self-updating. This requires apache to have write access to the PHP files. While chgrp'ing them all to www-data appears like a good practice to avoid making them world writable, I also wish to allow…
John
1
2 3 4 5 6