I'm trying to remove symlink, although I have appropriate permission, the operation is denied (the user is called capistrno
):
capistrno $ rm -f /var/www/app/current
rm: cannot remove `/var/www/app/current': Permission denied
the user should have all permissions to this file
lrwxrwxrwx 1 capistrano capistrano 42 17. mar 13.09 /var/www/app/current -> /var/www/app/releases/20130317120932/
capistrno $ file /var/www/app/current
/var/www/app/current: symbolic link to `/var/www/app/releases/20130317120932'
Any idea what's wrong?
EDIT:
folder /var/www/app
$ ls -laF /var/www/app/
total 16
drwxr-xr-x 4 www-data www-data 4096 17. mar 14.15 ./
drwxrwxr-x 4 capistrano www-data 4096 17. mar 00.01 ../
drwxrwxr-x 6 capistrano www-data 4096 17. mar 14.15 releases/
drwxrwxr-x 7 capistrano www-data 4096 17. mar 00.39 shared/
user capistrano
belongs to this groups:
$ groups
capistrano www-data rvm
Symlinks are always shown with 777 permissions and can be deleted by root, owner and owner group only.
I would suggest you split your operation in 2 parts:
It is cleaner and less prone to errors. You will also get the exact errors, for each of those commands..
Unless you made a typo while sanitizing this post, You've assigned ownership and group to capistrano, while the user name is suposed to be capistrno.
capistrano =/= capistrno