Re: Question about directory ownership

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 19, 2013 at 8:17 PM, Anthony <lists@xxxxxxxxxxxxxxx> wrote:
> Hello Everyone,
>
> How do I add myself as co-owner of a directory? I set up a new apache
> server and need to transfer files to /var/www/html. The problem is, of
> course, I've denied root login but don't have sufficient privs to
> login and transfer files under my username.
>
> How can I fix this?

There are a few ways to go about this.  There are lots of ways to
control access to files and directories on Linux systems.  ;-)

You could create a group with permissions to edit the directory, and
add yourself to it:

# create an 'htmleditors' group
groupadd htmleditors
# add 'anthony' to it
usermod -aG htmleditors anthony
# change the directory to be owned by the group
chgrp -R htmleditors /var/www/html
# grant read/write permissions to the group
chmod -R g+rw /var/www/html

Or you can use POSIX ACLs to just give yourself access:

# give 'anthony' Read/Write/eXecute permissions on all files in /var/www/html
setfacl -R -m u:anthony:rwX /var/www/html
# do the same for directories
find /var/www/html -type d | xargs setfacl -R -m d:u:anthony:rwX

You can even combine the two:

groupadd htmleditors
usermod -aG htmleditors anthony
setfacl -R -m g:htmleditors:rwX /var/www/html
find /var/www/html -type d | xargs setfacl -R -m d:g:htmleditors:rwX

See the man pages for the various commands used for more information
about what exactly is going on.

-T.C.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux