简体   繁体   中英

set folder owner group

I have application running on ubuntu 12.04 and when user submit file using submit form I got permission denied error. So it seems that user don't have permission to write. when I'm logged in as root and use ls -l folder_name it write

drwxrwxr-x   2 root root  4096 Dec  5 01:17 folder1
drwxrwxr-x   2 root root  4096 Dec  5 01:17 folder2

when I use chown myuser folder_name and repeat ls -l folder_name it gives me the same output so myuser is still not owner of the folders. How can I add myuser as owner of existing folders and all newly created folders inside existing folders. `

Several things to consider-

  • owner is root so either 'sudo chown' or become root to do the change
  • chown myuser:mygroup to change both the owner and group (or chgrp)
  • from your question it sounds like this is from a web page, so it will probably need to be owned by apache:apache or whatever your webserver runs as
  • you can't specify the owner of all newly (future) created folders inside these, just who has permissions (chmod) to create folders and then depends on what user is trying to do the creates.

the command is:

sudo chown -R apache:apache folder1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM