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

centosuser-accounts

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!

Best Answer

adduser ftpuser

passwd ftpuser # set the password

chown -R ftpuser /var/www/html/