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
Thanked 0 Times in 0 Posts
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
Thanked 1 Time in 1 Post
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
Thanked 0 Times in 0 Posts
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.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
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: 699
Thanked 90 Times in 81 Posts
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
Thanked 0 Times in 0 Posts
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
Thanked 1 Time in 1 Post
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
Thanked 40 Times in 39 Posts
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
Thanked 0 Times in 0 Posts
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 5 18th September 2014 09:49 AM
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 05:36 AM.


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