Changing Directory Ownership via Command Line

Trying to replace, delete or change files via FTP, you may notice you get insufficient permissions errors. If you haven’t seen this a lot, your first instinct is to try to change the permissions on the directories in question, in which case you will continue to get mooned. This issue is less about permissions per se than about directory ownership. If you’re running on a server that has some directories owned by nobody/99, that means the server itself is considered “owner” and individual users won’t be able to change or delete these. ((If your server requires 777 permissions for certain functions, then you most likely will have some directories “owned” by the server/nobody.))

chown -Rv username:groupname *

The username/groupname should be replaced with your info–but you don’t know this already, best to get out of there and get tech support to help you–and these two will normally be the same. The R makes it recursive, changing the files inside the directory as well as the directory you run the command on, and the v gives you verbose output so you can see what got changed.

Share Button

Solving FTP Deletion Error “550 Prohibited file name”

Trying to delete a file via FTP and unable to? Getting a “550 Prohibited file name” error? Annoying! But also very easy to fix. Create a php file called “unlink.php” with this code, replacing the “YOUR-FILENAME-HERE” with–what else?–your undeleteable file name.

<?php unlink('YOUR-FILENAME-HERE');?>

Upload it to the directory with the file in question, and visit the script in your web browser. It will remove the previously unruly file. ((Thanks to irasmith’s forum post for this solution.))

PHP noobs, please remember to have NO blank spaces before or after the beginning of your code in PHP files, or you’re liable to get a “Cannot modify header information/Headers already sent” error. You can create the file in a text program and simply rename it with a .php extension.

Share Button