sshfs-win icon indicating copy to clipboard operation
sshfs-win copied to clipboard

Random "Access denied" message creating files or directories when run CMD as admin, but operation is done anyway

Open nrs1022 opened this issue 4 years ago • 3 comments

Running as Admin an app and working with the mapped network drive through Explorer causes random "Access denied" messages creating files or directories, but operation is done anyway.

Steps: 1- Mount a SSHFS drive with Explorer. 2- Open CMD as Admin 3- Go to the mapped drive and try to create a nonexistant folder: mkdir example

"Access denied" is shown, but example dir is created anyway.

Tested on: Windows 10 (10.0.18363.778) and SSHFS 3.5.20024, WinFSP 2020.

Thank you! P.S. Awesome work! SSHFS-Win and WinFSP are great!

nrs1022 avatar Apr 23 '20 01:04 nrs1022

I believe the problem is that the file system is setup to be fully accessible from the user who "maps network drive" from the Explorer.

When running a command prompt as Admin some permissions may be missing, which is why you get "Access Denied", but you still have most permissions so the operation succeeds anyway.

Is there a need for you to use the file system both as a regular user and as an Administrator?

billziss-gh avatar Apr 23 '20 20:04 billziss-gh

No, isn't really a big issue for me. I have several scripts saved on my network dir, some of them needs to be run as Admin but knowing about this issue I can workaround it. Previously I've used samba shares (on the same server) to store the scripts, but SSHFS is very fast and outperforms Samba. Note problem is about creating files or directories. Modifying files seems to work fine (No problems detected up to now). It's just a little annoying issue, because you can see operation is successful (You can see the file or the folder created on server). Thank you for share your great work!!!

nrs1022 avatar Apr 24 '20 14:04 nrs1022

I believe the problem is that the file system is setup to be fully accessible from the user who "maps network drive" from the Explorer.

When running a command prompt as Admin some permissions may be missing, which is why you get "Access Denied", but you still have most permissions so the operation succeeds anyway.

Is there a need for you to use the file system both as a regular user and as an Administrator?

I have this needs lately. I need to install something onto a sshfs mount, but the installer insists being run as Admin.

netheril96 avatar Mar 29 '24 06:03 netheril96