FTP Apache permissions

  • Posted February 12, 2014

very basic question:

I have apache set up on a ubuntu droplet. created a newuser, gave him root access. when I log in as newuser through ssh/sftp I need to be able to upload files to /var/www but I dont have permission. How would I give newuser permission to upload and delete from that folder so I can actually put web pages up?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

How did you give him root access ? <br> <br>Anyway, a better option can be changing ownership of the files in /var/www to the yourself : apache and adding the user to the apache group. Then permissions of 775 on the folder will give user the proper read write permissions.

You can do that, it shouldn’t cause any issues.

would you add the admin account to the www-data group? or is that not necessary/recommended? <br> <br>and yes, i do use sftp

thanks! <br> <br>so what I have now is: <br>1. root user. not used <br>2. admin account with root privileges. this is the main account i will use to admin tasks <br>3. web account which I have assigned to the www-data group and given him/the group permission to read/write to /var/www. this is the main account i will use to do ftp tasks <br> <br>is this typically how user accounts are structured on servers? very new to webservers so still trying to figure out the correct things to do

There is no point of giving a user the root privileges, but to increase the risk to get your web server hacked easily… <br> <br>you need to give a user some privileges so that if the user got hacked, it is still safe to avoid high risk of breaking into your server. <br> <br>for what you are up to, read this and be careful when giving permission to user: <br> <br>