Thursday, June 9, 2016

Unable to access a windows share using UNC path



I'm trying to understand why my application running as a windows service as Local System account cannot access a shared folder on another PC using a UNC path.



Yet the same application can access a shared folder on a NAS device.



More detail:



I have a java app which reads the contents of a directory based on a UNC path.




When not run as a windows service the application can read both folder shares on other PC's as well as NAS devices.



Is it because the NAS device (Buffalo LinkStation) is using SAMBA? (Out of my confort zone here but that's the only thing I can think of)



If that's the case does it mean I would have to create an admin user for this service in order for it to work rather than local system account?


Answer



I suspect that the NAS device's share has guest enabled, or the computer name has rights to that share.



Local System has the privileges of the machine account on the network. (Both users and computers have AD accounts, yes.) For more information, see this link.




So yes, you'll need to add the account COMPUTERNAME$ (whatever the machine is named) to the share for the application to be able to access it.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...