# Sickbeard, SMBfs and permissions



## Halfe (Apr 23, 2014)

Is there anyone who is good at Jails, mounting Samba Share and Sickbeard?

Me and my Brother is running two FreeNAS servers over a VPN tunnel. VPN is working great and we have access to both our network. (25/25 mbit on both connections)
So lets say mine is S1 and my brother is S2

What i want is S1 to have full Access with "rwe" permissions. I have my own user on S2 that have full rwe access. so here is my problem

When i use mount_nfs i need to have the same users as S2 on S1 but i cannot do that so i found mount_smbfs that i can use my own user  like this

```
mount_smbfs -I 192.168.0.2 -U halfe //192.168.0.2/Storage1 /mnt/(local path)
Password:
```

okay so far ok.

So when i try to go into the folders using my self as root user with su.


```
ls -l
total 1216
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 ./
drwxr-xr-x  1 root  wheel  16384 Jan  1  1970 ../
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder1/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder2/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder3/
```

then i try to edit into the folders


```
mkdir 1
 ls -l
total 1232
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 ./
drwxr-xr-x  1 root  wheel  16384 Jan  1  1970 ../
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 1/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder1/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder2/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder3/
```

it works. fine
Now i try the same thing with a non root user


```
mkdir 2

ls -l
total 1248

drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 ./
drwxr-xr-x  1 root  wheel  16384 Jan  1  1970 ../
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 1/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder1/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder2/
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder3/
```
This is not working. Only Root have access to this folder now.

Now i mount this folder into Jail.
and since I have to be root to use jexec into jail i can create and remove folders on the mount

this is in jail

```
root@Download:~ #  mkdir /mnt/(folderpath)/2

root@Download:~ # /mnt/folderpath/ ls -l
total 1216
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:10 1
drwxr-xr-x  1 root  wheel  16384 Apr 22 22:19 2
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder1
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder2
drwxr-xr-x  1 root  wheel  16384 May 10  2013 Folder3
```

so far so good in Jail.

But now comes the part where its hard for me.

I'm trying to get Sickbeard to access those files, but they wont. 

i get an error msg says

```
2014-04-23 07:20:27 CP Server Thread-10 :: Failed creating /mnt/Media/(path to folder) : error 13 : Permission denied
```

and i dont know what permissions Sickbeard needs. Been googlin. but nothing has come up. 

So i asked around. come up with that i couold SSH into sickbeard to see if sickbeard has access to those files. So I Installed Python. and come up with this

```
root@Download:/usr/pbi/sickbeard-amd64/share/sickbeard/Sick-Beard # python2 SickBeard.py
The Python module Cheetah is required
```
If there is anyone who knows about SMBfs shares, if he/she could help me. i'm a bit stuck now and been trying to get this working for 3 weeks. 

How can i get SIckbeard to get access to those files. 

regards Halfe


----------



## SirDice (Apr 23, 2014)

On S2 your UNIX account (for lack of a better word) needs to have write permissions on the path of the share.


----------



## Halfe (Apr 24, 2014)

In my eyes I have full access to S2


This is a folder on S2 loged on with my own User in SSH

```
[halfe@Goliat] /mnt/Storage1/Media/Serier% ls -l
total 314
drwxrwxr-x  78 root   Media1  78 Apr 22 22:19 ./
drwxrwxr-x   4 root   Media1   4 May 10  2013 ../
drwxrwxrwx   2 halfe  Media1   2 Apr 22 22:10 1/
drwxrwxrwx   2 halfe  Media1   2 Apr 22 22:19 2/
drwxrwxr-x  10 root   Media1  10 May 10  2013 Folder1/
drwxrwxr-x   8 root   Media1  14 May 10  2013 Folder2/
drwxrwxr-x   8 root   Media1   8 May 10  2013 Folder3/
```


----------



## SirDice (Apr 24, 2014)

Is your account a member of the Media1 group? And just a note, only use lowercase for both user and group names. Remember UNIX is case-sensitive and mixing case with user and group names can cause problems. 

What you really want to do is mark the directory SETGID so new files are automatically owned by the group. You'll also want to add to smb.conf:

```
create mask = 0775
directory mask = 2775
```


----------

