# Transmission download file permission



## Dead_Lemon (Apr 27, 2012)

Hey all,

I'*m* rather new to Freebsd FreeBSD, and the *nix world in general. I've built myself a file/download server and all has been ok for now, but I'm confused with the way Transmission is creating folder and privileges. It seems that when I set a file to download, the folder it creates, sets its permissions as root, so I cannot delete the file over my network without having to SSH into the box and using *chmod 777* on the folder.

For the shared folder I'm using Samba (which I'm still trying to figure out for the most part) shares for my windows network, using a user name, NFS, as the login account to the share (I used a tutorial on ZFSguru, and used there same settings).

*I*s there a way to change this? *A* setting in Transmission that changes what account it uses to create the new directories?


----------



## sk8harddiefast (Apr 27, 2012)

Install sudo. Create a user. Edit the sudoers file adding the user to it. Install Transmission as the user using sudo. Do not run FreeBSD as root. Always create a user and use the sudo command. Working as root all config files go in /root and not in /home/user. They have different permissions.


----------



## Dead_Lemon (Apr 27, 2012)

Awesome, thanks, so I must uninstall transmission first, then install it onto my other account?


----------



## sk8harddiefast (Apr 28, 2012)

Yep. Uninstall it (as root or as user using sudo) and just as user run: [cmd=]sudo make install clean[/cmd] into Transmission port.


----------



## Dead_Lemon (Apr 28, 2012)

Ok, reinstalled it under a non root account

But I still can*'*t delete the folders Transmission makes, says I now require permission from Unix user/transmission. I'm confused now how I would set my network login account to have equal permissions as transmission.


----------



## SirDice (Apr 30, 2012)

Simple solution, no sudo or anything else needed. Set a download directory in transmission. I'm using /storage/media/transmission/Downloads/ but you can use any directory you want. The important things are its permissions.

Set it to:

```
root@molly:~#ls -ld /storage/media/transmission/Downloads/
drwxrwxr-x  46 transmission  transmission  476 Apr 29 20:49 /storage/media/transmission/Downloads/
```

Note the write permissions on the group transmission. Now add your user to that group:
[cmd=]pw groupmod transmission -m dice[/cmd]

Log off and log back in. The user dice now has write access to the transmission download directory. And thus can delete files there.


----------



## Dead_Lemon (May 1, 2012)

I'm still not winning


```
[root@server /usr/home/admin]# ls -ld /tank/download/torrents/test              
drwxr-xr-x  3 transmission  admin  3 May  1 18:50 /tank/download/torrents/test
```


----------



## SirDice (May 2, 2012)

Ah, forgot to set the umask :e

Open settings.json when transmission is stopped. Look for:

```
"umask": 18,
```

Change that to 2.


----------



## Dead_Lemon (May 2, 2012)

Still not working, but I think I know why. I used this tutorial when setting it up initially http://pynej.blogspot.com/2010/02/set-up-transmission-deamon-bittorrent.html. I now understand this article way better now, not like when I first installed it, blindly tapping away.

In the tutorial he uses [cmd=]sudo pw usermod USERNAME -G  transmission[/cmd] and I used that, not originally knowing exactly what it did and I just noticed the one use comment


> However, 'sudo pw usermod USERNAME -G transmission' did remove my user from the wheel group. Better to use 'sudo pw groupmod transmission -m USERNAME'



*I*n the original command I used Admin as my USERNAME (admin is my general purpose local machine account) [cmd=]sudo pw usermod Admin -G  transmission[/cmd]

I noticed today that in your example 
	
	



```
root@molly:~#ls -ld /storage/media/transmission/Downloads/
drwxrwxr-x  46 transmission  transmission  476 Apr 29 20:49 /storage/media/transmission/Downloads/
```
you have transmission:transmission as folder permissions whereas mine is transmission:admin

```
[root@server /usr/home/admin]# ls -ld /tank/download/torrents/test              
drwxr-xr-x  3 transmission  admin  3 May  1 18:50 /tank/download/torrents/test
```

*N*ot sure how to fix this, or even view all my different groups (also, nfs, is the group I'm looking to give permissions to have read write access, as it is my samba account).


----------



## SirDice (May 3, 2012)

Note that setting the umask in settings.json only works for new files that are downloaded. Previously downloaded files aren't changed.



			
				Dead_Lemon said:
			
		

> Not sure how to fix this, or even view all my different groups


chown(8) or chgrp(1) are the commands you're looking for. To figure out which groups are attached to your user account use id(1).


```
dice@molly:~%id -a
uid=1001(dice) gid=1001(dice) groups=1001(dice),500(admin),921(transmission)
```

chown(8) or chgrp(1):
`# chown -R transmission:transmission /tank/download/torrents/`
`# chgrp -R transmission /tank/download/torrents/`

The -R will make sure all files and directories are set recursively.


----------



## Dead_Lemon (May 3, 2012)

It's working now. It must have just been the folder permissions then.

I found that after changing the permissions that I could immediately delete those folders I downloaded with "umask": 2 adjustment, what exactly does that do?

Thanks very much for all your help


----------



## SirDice (May 3, 2012)

Think of umask(1) as a filter. Files are created with 666 permissions and the umask filters some of those bits out. A umask of 2 will make files 664, which is read/write for the owner and group and only read for everyone else.


----------



## Dead_Lemon (May 3, 2012)

Awesome, thanks so much for all the help.


----------

