Help request. FTP user to var/www/html

Hi all.

I appologise this is my first post, I will gladly have a further look around to see if this has been posted elsewhere, but so far it has not, or it doesnt quite explain in full what I need. If anyone here can help me out, I would really appreciate this. I want to make sure I do this right, as in the past I made a huge error and messed up my server. :frowning: :frowning:

I have two servers.

1, is our online dedicated server for mainly gaming, but I also use it as a hosting site for very basic webpages and a forum. This is on Centos 5.
2, My second server is a raspberry PI which I am using to test and learn from which is on Debian at home. Both servers are setup with just CLI access and Webmin.

I fully understand that these are two very different distro's but I am hoping what I need to do, can apply to both. All I want to be able to do is create a user, which has full read/write access ( and also be able to change a subfolder's acess ( to 777 for example ) to the var/www ( PI ) or var/www/html ( Centos ) folders using a client FTP application from a Windows PC, such as Filezilla.

As an example from my Raspberry PI, I wanted to try this from root:

chown -R piweb:piweb /var/www/

I assume, this on Centos would be :

chown -R webuser:webuser /var/www/html

But im not so sure if this is right, or if there is a better way to do it? Any help would be great, thanks for your time.

Thanks

From the man page on chown:

This means you gave ownership privledges to "piweb" and "webuser" to /var/www and all its sub-directories. If this is what you are trying to accomplish.

To check which user owns the files use this:

ls -l

This will show the user who owns the files in the current directory.

The syntax you have used is correct for Debain and CentOS. However, you can shorten this by using this:

chown -R piweb. /var/www/

Instead of:

 chown -R piweb:piweb /var/www/ 

If you need to change permissions on files or directories you will need to use chmod instead of chown. I should warn you that using 777 permissions on a file viewable to the web is very dangerous. You would be giving the entire Internet read, write, and execute permissions on these files which is a huge security risk. I would strongly suggest using 755 or 644 permissions instead which should allow you the same functionality, but with better security.

If you want full read, write, and execution access remotely it would be far safer to use SSH or VNC with a user and then login to root. However, for the purposes of FTP this you should be fine with just using 755 and 644.