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 12th December 2012
Eend's Avatar
Eend Eend is offline
Just Hatched
 
Join Date: Apr 2009
Location: Drenthe
Posts: 3
Thanked 0 Times in 0 Posts
Default Writable CIFS share inside jail

I've recently set up a FreeBSD 9.0 RELEASE machine as a jailhost. One of the jails needs to write to a CIFS/SMB share on a FreeNAS 8.2 system. I can mount the share on the jailhost, but i can only write to the share as root. And i don't want the application writing to the share running as root, as the app has it's own account: "_user".

After I do
Code:
mount_smbfs -N //user@nas/datastore1 /usr/jails/jail1/mnt/datastore1
I've already set up a .nsmbrc file, and tried /etc/fstab:
Code:
//user@nas1/datastore1 /usr/jails/jail1/mnt/datastore1 smbfs   rw,noauto,-u=_user,-g=_user       0       0
After that, i rebooted the jailhost, but the share isn't mounted on boot, and when i mount it manually i still can't write to the share..

See the permissions below:

Code:
# ls -la
total 24
drwxr-xr-x   3 root  wheel    512 Dec 12 18:43 .
drwxr-xr-x  12 root  wheel    512 Nov 25 18:01 ..
drwxr-xr-x   1 root  wheel  16384 Jan  1  1970 media
I've spent the last few days googling for this, but i can't find much useful..

Is it possible to mount a CIFS share in a jail, and have the jail write data to that share?
Reply With Quote
  #2   (View Single Post)  
Old 2nd April 2013
Overrider Overrider is offline
Real Name: Dave
New User
 
Join Date: Dec 2012
Location: Virtually everywhere
Posts: 6
Thanked 0 Times in 0 Posts
Default

I think you should first figure out how to mount your share correctly inside your main host and be able to write to it using the user you want - then try to make it work from inside a jail, which should not be any different afaik.

When you mount manually from inside the main host, maybe try this way, i have no test system right now but it might help:

Code:
mount_smbfs //FREENAS/SHARENAME /mnt -o username=USERNAME,password='PASSWORD',domain=DOMAIN_IF_ANY,iocharset=utf8,ro
Can you now do a "cd /mnt" and write stuff there as USERNAME ?

Last edited by Overrider; 2nd April 2013 at 03:23 PM. Reason: mispelled mount_smbfs
Reply With Quote
  #3   (View Single Post)  
Old 2nd April 2013
Eend's Avatar
Eend Eend is offline
Just Hatched
 
Join Date: Apr 2009
Location: Drenthe
Posts: 3
Thanked 0 Times in 0 Posts
Default

I figured out how to mount it in the host: create a new user with the same (G)UID and username on the host, mount and assign the proper permissions. I can then write to the share. But there probably is a better way to do that.
Reply With Quote
  #4   (View Single Post)  
Old 3rd April 2013
Overrider Overrider is offline
Real Name: Dave
New User
 
Join Date: Dec 2012
Location: Virtually everywhere
Posts: 6
Thanked 0 Times in 0 Posts
Default

Why not do it the same way in the jail? If it works in the Host, why not in the Jail, assuming that the jail contains the needed programs etc.
Reply With Quote
  #5   (View Single Post)  
Old 3rd April 2013
Eend's Avatar
Eend Eend is offline
Just Hatched
 
Join Date: Apr 2009
Location: Drenthe
Posts: 3
Thanked 0 Times in 0 Posts
Default

It does work inside the jail, but the problem is that i have to manually mount the shares every time i reboot the server. And since this is a virtual machine on my personal testbed, that happens quite often

ps. i thought this forum was dead..

Last edited by Eend; 3rd April 2013 at 06:23 PM. Reason: Clarification
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
Can FAT32 partition be writable by ordinary user ? sw2wolf OpenBSD General 5 24th March 2012 03:15 PM
Dennis Ritchie: the other man inside your iPhone J65nko News 2 16th October 2011 09:56 PM
Misc. BSD/UNIX Inside Mac OS X 10.7 Lion Server: Apple replaces Samba for Windows networking service J65nko News 0 24th March 2011 08:06 PM
pkg inside non-global zone? nacredata Solaris 2 30th September 2008 11:50 PM
no internet connection inside jail...? bgobs FreeBSD General 11 17th June 2008 04:36 PM


All times are GMT. The time now is 05:26 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