Linux Advice on Setting up Permissions on Ubuntu 10.04 Server

Gaurish

Level F
Hey,
I run a server powered Ubuntu 10.04 LTS. the software stack that I use comprises of
  • PHP fpm-fcgi Version 5.3.6
  • Web Server: nginx/0.8.54

To make, things like wordpress work properly. I have done chown www-data:www-data on my public_html folder. This was all files are easily modifiable by nginx and things like Auto Updating wordpress work as expected.

The problem arises when I login via ftp and try to upload new files or change existing ones. Since, I use username as Gaurish & all files are owned www-data my requests are denied.

Code:
Response:	220 (vsFTPd 2.2.2)
Command:	USER gaurish
Response:	331 Please specify the password.
Command:	PASS ************
Response:	230 Login successful.
Command:	OPTS UTF8 ON
Response:	200 Always in UTF8 mode.
Status:	Connected
Status:	Starting upload of /tmp/cachegrind.out.5513
Command:	CWD /home/gaurish
Response:	250 Directory successfully changed.
Command:	PWD
Response:	257 "/home/gaurish"
Command:	TYPE I
Response:	200 Switching to Binary mode.
Command:	PORT 192,168,1,6,214,6
Response:	200 PORT command successful. Consider using PASV.
Command:	STOR cachegrind.out.5513
[COLOR="red"]Response:	553 Could not create file.[/COLOR]
Error:	Critical error
Status:	Disconnected from server
I need a way by which I(gaurish) & nginx(www-data) can both modify the files. Any idea how to do that?
 
Add gaurish to www-data group or use sticky bits for access. Since associating sitcky bits is risky I'll recommed you to add Gaurish to www-data group.

Code:
usermode -G <groupname> username

usermod -G www-data gaurish

By that way you can access the files. Make sure the files have necessary permission for group members. You can change permission on group level by using
Code:
chmod rw+g <file+name>

You can view the permission of the file by

Code:
 ls -l
 
Back
Top