Change ownership of directory and all contents to a new user from root

I created a website under /var/www/html/ all under root, all images, files, .htacess, directories, etc... I uploaded and configured everything as root.

I want to make it it's own username/password so it's not owned by root. I currently do not have the user account made either, I want to also setup FTP for the user account.

There is also about 30GB of images in the folder as well.

How can I go about changing all of this?

I am running CentOS 5.5 64 bit.

Thank you!


Solution 1:

adduser ftpuser

passwd ftpuser # set the password

chown -R ftpuser /var/www/html/

Solution 2:

I think the answer from packs is generally correct, but you should be careful about changing ownership of too mrny files and directories unexpectedly. It's a good idea to run something like

find /var/www/html -print | less

and verify it matches the set of files and directories you expect to change.