DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 5th July 2008
tad1214 tad1214 is offline
Real Name: Thomas Donnelly
Fdisk Soldier
 
Join Date: Jun 2008
Location: Houston, TX
Posts: 60
Default Non-root user editing automatically mounted smb share

Hi,

I'm sure this is fairly simple but I can't seem to find a good answer. All solutions require editing the devfs file and since these aren't in /dev it really wouldn't work....

I have a smb share on another server to hold all my music, when I am a user, I can not edit data in this mount point.

I have this line in my /etc/fstab
//tdonnelly@otter/music /mnt/Music smbfs rw,-N

How to I make it so non root users can edit data in the Music directory?

Thanks!
-=Tom
Reply With Quote
  #2   (View Single Post)  
Old 5th July 2008
kazcor kazcor is offline
Real Name: Registreed Usre
Port Guard
 
Join Date: May 2008
Location: bliner, erg
Posts: 20
Default

Never dealt with this, but maybe the switches mentioned in mount_smbfs(8) are what you're looking for?
Quote:
-u uid, -g gid
User ID and group ID assigned to files. The default are owner
and group IDs from the directory where the volume is mounted.
Reply With Quote
  #3   (View Single Post)  
Old 6th July 2008
tad1214 tad1214 is offline
Real Name: Thomas Donnelly
Fdisk Soldier
 
Join Date: Jun 2008
Location: Houston, TX
Posts: 60
Default

Hmm... where would I put this in my fstab though?
Reply With Quote
  #4   (View Single Post)  
Old 6th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Well, perhaps the same way you added that -N flag... *sigh*

//tdonnelly@otter/music /mnt/Music smbfs rw,-N,-g smbgroup
Reply With Quote
  #5   (View Single Post)  
Old 6th July 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Or, configure your Samba server to use force group on the share, set the create mode to give group write access, and put all your remote users into that group on the Samba server.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #6   (View Single Post)  
Old 6th July 2008
tad1214 tad1214 is offline
Real Name: Thomas Donnelly
Fdisk Soldier
 
Join Date: Jun 2008
Location: Houston, TX
Posts: 60
Default

Hmm.... I don't think its an issue with the samba server as when I use Konqueror it works just fine (via smb:// rather than /mnt/Music).

changed my fstab to this
Code:
//tdonnelly@otter/music      /mnt/Music        smbfs   rw,-N -g 0 -u 1001
I also tried
Code:
//tdonnelly@otter/music      /mnt/Music        smbfs   rw,-N, -g 0, -u 1001
and If I do the following:
Code:
Barracuda# ll /mnt/
total 22
drwxr-xr-x  1 root  wheel  16384 Dec 31  1969 Music
so that would tell me that the user is not being applied.

Last edited by tad1214; 6th July 2008 at 08:38 PM.
Reply With Quote
  #7   (View Single Post)  
Old 7th July 2008
kazcor kazcor is offline
Real Name: Registreed Usre
Port Guard
 
Join Date: May 2008
Location: bliner, erg
Posts: 20
Default

Sorry, my mistake
Of course, fstab handles whitespace as delimeters between the various fstab fields. So if you need to specify options that require further parameters, you will require some sort of workaround.
I don't know how the fstab is parsed, so maybe even this solution may help:
Code:
//tdonnelly@otter/music   /mnt/Music   smbfs   rw,-N,-g\ 0, -u\ 1001
In any case as mentioned in the manpage, it should be possible to assign the user/group settings to the destination directory, before mounting to get this issue solved.

Another way would be to create a script in /sbin that does the dirty work for you. E.g. create something like mount_smbfs2 which then calls mount_smbfs with the correct options and in the fstab provide smbfs2 as filesystem type
Reply With Quote
  #8   (View Single Post)  
Old 7th July 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

I think you should be able to strip all the spaces out of that string, like this:
Code:
//tdonnelly@otter/music      /mnt/Music        smbfs   rw,-N,-g0,-u1001
(goes to check man fstab)
(checks google)
hmm, not a lot of information about it.

That said, the default user and group for smb filesystems (and msdos too) is the user and group of the directory entry it is mounted on. This is the way I have always dealt with user:group issues.

Last edited by robbak; 8th July 2008 at 03:47 AM.
Reply With Quote
  #9   (View Single Post)  
Old 8th July 2008
tad1214 tad1214 is offline
Real Name: Thomas Donnelly
Fdisk Soldier
 
Join Date: Jun 2008
Location: Houston, TX
Posts: 60
Default

Quote:
Originally Posted by robbak View Post
That said, I the default user and group for smb filesystems (and msdos too) is the user and group of the directory entry it is mounted on. This is the way I have always dealt with user:group issues.
Success!
Mounted in /home/TDonnelly/music/

RW access.
Reply With Quote
Reply

Tags
mount_smbfs, samba

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
HOWTO: mounting an USB device as normal non-root user in OpenBSD J65nko Guides 6 20th May 2017 12:03 PM
Startx executes as root, "startx:not found" as user Mr-Biscuit NetBSD Installation and Upgrading 4 27th May 2009 08:44 AM
root: unknown user roddierod FreeBSD General 9 28th April 2009 10:18 PM
Run daemon as other user than root phreud FreeBSD General 8 11th November 2008 04:11 AM
Mounting samba share as normal user rex FreeBSD General 4 27th October 2008 05:17 PM


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick