# [Solved] Can't write to certain Samba shares

## chix4mat

Hi all: 

I have a couple of Samba shares that I'm unable to write to. One is for my Linux desktop; the other is for a NAS folder (I'm mapping a preexisting network share).

```
drwxr-xr-x 27 rwilliams rwilliams 4096 Apr  9 22:04 rwilliams 

drwxrwxrwx 1 root      root        8192 Apr  9 19:37 emulation-torrents

drwxr-xr-x 2 rwilliams root           0 Apr  9 18:19 nas-torrents

drwxrwxrwx 1 root      root        8192 Apr  8 16:48 windows 
```

The reason I am mapping a preexisting network share through Samba is so that I can map it inside of a Windows virtual machine guest - it helps me keep the exact same drive letters between non-native and native Windows. It's a strange setup, but I still think it should work. Here's the Samba configuration:

```
[Linux Desktop] #ext4 

path = /home/rwilliams/Desktop

public = yes

guest ok = yes

writable = yes

[Emulation Torrents] #ntfs *

path = /mnt/emulation-torrents

public = yes

guest ok = yes

writable = yes

[Torrents] #NAS share

path = /mnt/nas-torrents

public = yes

guest ok = yes

writable = yes

[Windows] #ntfs *

path = /mnt/windows/Users/Rob/AppData/Roaming/uTorrent

public = yes

guest ok = yes

writable = yes
```

The shares marked with an * are writable. 

Any help would be greatly appreciated.

Thanks much!

----------

## beandog

If you're connecting with user 'rwilliams' try setting 'force user = root' and 'force group = root' for r/w to the directories owned by root.

----------

## chix4mat

 *beandog wrote:*   

> If you're connecting with user 'rwilliams' try setting 'force user = root' and 'force group = root' for r/w to the directories owned by root.

 

That worked beautifully; thanks a ton! I'm not sure forcing a user is the "right way", but given I don't want to require a login and password, this is perfect.

----------

## beandog

 *chix4mat wrote:*   

>  *beandog wrote:*   If you're connecting with user 'rwilliams' try setting 'force user = root' and 'force group = root' for r/w to the directories owned by root. 
> 
> That worked beautifully; thanks a ton! I'm not sure forcing a user is the "right way", but given I don't want to require a login and password, this is perfect.

 

Well, you're just forcing it to read/write as the same user that the directories you mentioned are owned by.

However, it's a nice feature that Samba has, and in many cases, makes file sharing between groups easy if you have a similar situation -- filesystem permissions are for one user, Samba users are another.  :Smile: 

----------

