views:

523

answers:

2

I'm writing a Windows Service in C#. I have a samba share on a linux server that I can browse/read/write from the windows machine, and I have it mapped to a drive letter. The Windows service is running as the SYSTEM user and cannot write to the share.

What should I change?

A: 

You need to either make the share visible to the System User. or install the service as a User other than the Local System Account that actually has permission to browse the share.

You can change the installation account in the Project Installer by setting the following 2 properties. (it's in the ProjectInstaller.Designer File

this.serviceProcessInstaller1.Username = "DOMAIN\\UserName";
this.serviceProcessInstaller1.Password = "Password";
Eoin Campbell
Do you know how to make the share visible to the System User?
Liam
A: 

I used an entry like this in my samba configuration file (smb.conf) to make it writable by any user.

[myshare]
   comment = My Share
   path = /home/myusername/myshare
   public = yes
   writable = yes
   #maps all users to the nobody user?
   only guest = yes
Liam

related questions