Linux Certification, System Administration, Programming, Networking Books
Linux Permissions

How can I give a user root access to the /var/www/ directory without having to use sudo/su?

I've added the user to the root group, but still can't write to the directory.

---------------------/

Give the group write access to the directory and contents:

# chmod -R g+w /var/www

---------------------/

I understand the use of chmod for a single file or directory, but if you use it ona directory does it replicated down to the sub directories and files? Or do those have to be done independently? Also If I am not the owner of a file can I give myself full permissions to it without giving permissions to the group? Or how can I give another group permissions? Do I first need to take ownership? If so how?

---------------------/

For evident security reason, you cannot modify the file privilege if you are not either the owner or root(administrator).
for recursive (directory and sub-dir) you can use the -R option:
chmod -R 770 /directory
or chmod -R o-rwx /directory

---------------------/

You use 'chown' to change ownership and 'chgrp' to change group of a file/directory.
But you have to have appropriate permission. Basically, if you don't have permission to write to the file/directory, you won't be able to change it's ownership.

Quick Links:
Do you have a Linux Question?

Linux Home: Linux System Administration Hints and Tips