17b9a [Solved] Transmission download file permission - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Web & Network Services

Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old April 27th, 2012, 19:36
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default Transmission download file permission

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).

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

Last edited by DutchDaemon; April 27th, 2012 at 23:30. Reason: Proper capitalization and punctuation.
Reply With Quote
  #2  
Old April 27th, 2012, 22:34
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,720
Thanks: 215
Thanked 142 Times in 88 Posts
Default

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.
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416

Last edited by DutchDaemon; April 27th, 2012 at 23:31.
Reply With Quote
The Following User Says Thank You to sk8harddiefast For This Useful Post:
Dead_Lemon (April 27th, 2012)
  #3  
Old April 27th, 2012, 22:53
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Awesome, thanks, so I must uninstall transmission first, then install it onto my other account?
Reply With Quote
  #4  
Old April 28th, 2012, 00:30
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,720
Thanks: 215
Thanked 142 Times in 88 Posts
Default

Yep. Uninstall it (as root or as user using sudo) and just as user run: sudo make install clean into Transmission port.
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416

Last edited by DutchDaemon; April 28th, 2012 at 04:26. Reason: It's "yeah" or "yep". "Yeap" is not a word.
Reply With Quote
  #5  
Old April 28th, 2012, 15:25
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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.

Last edited by DutchDaemon; April 29th, 2012 at 01:10. Reason: Proper punctuation.
Reply With Quote
  #6  
Old April 30th, 2012, 11:17
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

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:
Code:
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:
pw groupmod transmission -m dice

Log off and log back in. The user dice now has write access to the transmission download directory. And thus can delete files there.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.

Last edited by DutchDaemon; May 1st, 2012 at 01:20.
Reply With Quote
  #7  
Old May 1st, 2012, 18:00
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

I'm still not winning

Code:
[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
Reply With Quote
  #8  
Old May 2nd, 2012, 07:00
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

Ah, forgot to set the umask

Open settings.json when transmission is stopped. Look for:
Code:
    "umask": 18,
Change that to 2.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #9  
Old May 2nd, 2012, 20:43
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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

In the tutorial he uses sudo pw usermod USERNAME -G transmission and I used that, not originally knowing exactly what it did and I just noticed the one use comment
Quote:
However, 'sudo pw usermod USERNAME -G transmission' did remove my user from the wheel group. Better to use 'sudo pw groupmod transmission -m USERNAME'
In the original command I used Admin as my USERNAME (admin is my general purpose local machine account) sudo pw usermod Admin -G transmission

I noticed today that in your example
Code:
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
Code:
[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
Not 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).

Last edited by DutchDaemon; May 3rd, 2012 at 00:06. Reason: Mind your writing style: http://forums.freebsd.org/showthread.php?t=18043
Reply With Quote
  #10  
Old May 3rd, 2012, 07:25
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

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

Quote:
Originally Posted by Dead_Lemon View Post
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).

Code:
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.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
Dead_Lemon (May 3rd, 2012)
  #11  
Old May 3rd, 2012, 16:51
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #12  
Old May 3rd, 2012, 17:19
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

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.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
The Following User Says Thank You to SirDice For This Useful Post:
Dead_Lemon (May 3rd, 2012)
  #13  
Old May 3rd, 2012, 21:40
Dead_Lemon Dead_Lemon is offline
Junior Member
 
Join Date: Apr 2012
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Awesome, thanks so much for all the help.

Last edited by DutchDaemon; May 4th, 2012 at 00:15.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] download samba file from command line (where is smbget in samba4?) kenorb Web & Network Services 5 November 1st, 2010 13:05
[Solved] PF ALTQ + transmission daemon lemurid Firewalls 4 April 2nd, 2010 12:25
[Solved] dri-7.4.4,2.tbz file download problem Oz Installation and Maintenance of FreeBSD Ports or Packages 3 April 1st, 2010 02:17
[Solved] Transmission stalls on symlinks naguz Installation and Maintenance of FreeBSD Ports or Packages 5 March 12th, 2010 17:24
Transmission watch-dir on ftp [FreeNAS] pustar Web & Network Services 3 November 2nd, 2009 15:35


All times are GMT +1. The time now is 09:13.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0