Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Ubuntu 14.04 and I have a mounted drive to a network storage device (buffalo drive). I have been able to delete files within the folder that I am working in, logged in as USER1. The file permissions of a folder that I am trying to delete is below:
drwxr-xr-x 2 root root 0 Oct 10 2012 Long Short Fund
When I run rsync, I am getting an error saying that it can't be copied. There is a permission denied error below:
rsync: readdir("/media/winacctbuffalo/New_Acct/Saved_K_GP2000/Maher/Long Short Fund"): Permission denied (13) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]rsync: readdir("/media/winacctbuffalo/New_Acct/Saved_K_GP2000/Maher/Long Short Fund"): Permission denied (13) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]
When I try to delete it, I am getting the same error. I tried sudo chmod -R 777 foldername
but, I am still unable to delete it. I also tried to
sudo chown user1:user1
but that didn't work.
I posted this in security thread but feel free to move if this is incorrectly place. Any ideas of what it might be or how I can delete it. The buffalo drive is viewable in a windows environment and I tried to delete it from the gui in windows but it wouldn't delete either. Not an urgent matter but it would be good to learn a new trick of how to delete the file.
How are you running rsync? As a USER or as ROOT? That directory is 755 so only Root can write anything into it while a user can read or execute anything in that directory. If you are running rsync as a USER try running it as ROOT and it should work.
Same goes with Deleting it are you trying to delete is as a USER or ROOT? Root owns it so Root is the only one who can delete it.
another thing crossed my mind how is it mounted as rw or ro? You can see this with;
I run a bash script and execute it by SUDO CRONTAB -E so I believe I am running it as root. The bash script (.sh) file that I am executing is owned by root as well:
-rw-r--r-- 1 root root 345 Jun 30 14:24 myscript.sh
Here is also the mount output for the drive in question:
//10.140.6.100/share on /media/winacctbuffalo type cifs (rw,username=specialist,password=password,iocharset=utf8,sec=ntlm)
I think I have tried to run:
SUDO RMDIR /media/"Long Short Fund"
but, this didn't work. Not sure if it is some weird thing going on with the file, but I can't even delete it in Windows.
//10.140.6.100/share on /media/winacctbuffalo type cifs (rw,username=specialist,password=password,iocharset=utf8,sec=ntlm)
Is this a windows machine? If it is, does the user have the rights to remove directories from the system?
Just because you mounted it as 'rw' doesn't mean you will have those right is the hosting server does not allow you to do this.
It is a Buffalo NAS drive. I am going to try the suggestions and get back to you. I seem to have rights to all other files other than this folder. I am suspecting a corrupt folder....
I haven't been able to delete the file, but I am assuming it may be a corrupt folder. I also tried deleting it with fileassasin and that didn't work either because it is a folder. However, I think this is probably a corrupt folder. Let me know if anyone else thinks of anything. I will close thread for now. Cheers!
For a local filesystem, the last resort is to run debugfs on the partition holding the filesystem, use the clri command to clear the bad inode, then run fsck to clean up the resulting filesystem inconsistencies. Whether you can log into your NAS device and have the necessary access to do that is another question.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.