icacls is giving access denied on remote file system

6

1

I am working on remote drive mounted on my system where i created some file i need to set some permission for that file.

I used icacls but its not working.

When i am trying to access file permission its working fine.

Z:\test_permission>icacls file1.txt 
file1.txt "my user name":(I)(RX,W,DC) 
Everyone:(I)(RX)

While when i try to change its permission it says access denied.

Z:\test_permission>icacls file1.txt /deny "user name":R 
file1.txt: Access is denied. 
Successfully processed 0 files; Failed processing 1 files 

For work around: When on the same disk we are working from Linux and used chmod then all work fine. Now i am trying to do same thing using Windows so i am using icacls. Also i can't use Cygwin i have to use some Windows command only.

Please correct me if i am doing something wrong.

Abhishek

Posted 2013-01-24T04:52:46.940

Reputation: 63

one more thing if it may useful the remote drive hv FAT file system. and my local drive is NTFS – Abhishek – 2013-01-24T05:38:17.083

Answers

1

You do not have "Change permissions" rights as the user you are running icacls as. Either run the script/command prompt as administrator or make sure your user has change permission rights on the remote folder (and the files therein).

enter image description here


I Just saw your comment in your original question. FAT formatted drives do not have permissions settings. That is why the security tab is not there for you. On the server side when you are setting up folder sharing you should be able to set some basic permissions up (I don't know what OS the other machine is but I am assuming Win 7 for my example)

On the computer that is hosting the share, go to Properties->Sharing->Advanced Sharing->Permissions.

enter image description here

From there you need to make sure your user you are connecting as has Change permissions to be able to modify files.

Scott Chamberlain

Posted 2013-01-24T04:52:46.940

Reputation: 28 923

thx scott for quick reply. I want to confirm something that i can create/delete files overther. one more question how can i check permission over there as right click->properties only giving 3 tabs (general, previous version and customize) there is no security tab where i can check permissions :( should i contact drive owner for these? – Abhishek – 2013-01-24T05:47:33.010

If the security tab is not showing up I am not sure what could be wrong, It shows up fine when I tried it on my machine. Perhaps try setting your permissions up on the dive owner's computer.

– Scott Chamberlain – 2013-01-24T16:42:37.633

4

Run Windows Command Prompt as administrator and then run:

takeown /R /F file1.txt

icacls file1.txt /t /c /GRANT Everyone:F

It works with folders as well.

Marco Lackovic

Posted 2013-01-24T04:52:46.940

Reputation: 506

This worked until I ran into filename too long issue. The lifesaver I found is SetACL which I highly recommend

– Miserable Variable – 2017-05-08T18:44:04.083