0

At work I am trying to figure out how I can connect a Linux shared directory (Samba) to Windows Servers. We have files stored on this Linux server that we try to access from a dotNET application on a Windows server.

We want a connection between the two, not a directory mapping an user could make from the Windows machine. As far as I see it we have the following options:

  1. Have an active share on the Linux machine with the Windows servers that can access specified. I can specify the Linux directory path from within the dotNET application. This will be the best option.
  2. Have the share as a mapping on the Windows server and specify the path within the application to point towards the Windows server path. We can not map it as an user because the dotNET application doesn't run as an user.

Could anyone help me out a bit here? Is Samba the way to go? Are there other options, and what are the best options in your opinions? Sorry if I am a bit vague, if extra information is needed I will happily provide!

Best regards,

Roël

1 Answers1

0

Is Samba the way to go?

Short answer - Yes.

We want a connection between the two, not a directory mapping an user could make from the Windows machine.

Access to Samba shares can be restricted.
If you only want your Application to be accessing this share, then connect to the share using credentials known only to the Application.

the dotNET application doesn't run as an user.

Yes, it does, but it might be one of the many "System" Accounts. Most Windows Services run this way.

Note that these accounts are generally limited to what's "on the box".
They cannot see anything across the network. For that, you'll need to investigate things like the NETWORK_SYSTEM account or, perhaps, a dedicated account under which you run your Application.

Phill W.
  • 1,479
  • 7
  • 7
  • Thanks for your reply! A collegue and myself got a Samba share running on a Windows server and accessible. However now I am conflicted it might be the dotNET application that is giving me a hard time as well. When I enter the URL of a file on the Linux server I get the pdf file displayed no problem. The file can not be found when I try to access it through the dotNET application. To me it says Samba might not even be neccesairy and it might indicate a problem within the dotNET application because i can reach the file. Or am I missing something? – rkonings Jun 22 '22 at 09:50
  • YOU are running in YOUR Security Context, which can see the network and access the Samba share. Your APPLICATION is running in ITS Security Context, which may or may not be able to see the network at all and may or may not have access to your Samba share. – Phill W. Jun 27 '22 at 12:58
  • Thanks, that makes a lot of sense! If the System admins would make an service account that has rights and where the application would run under it should work I think. The application now runs as an local app pool user, makes sense that accessing that mount doesn't work. – rkonings Jun 30 '22 at 12:04