Hi all, Is it possible to specify an arbitrary unix directory to be mounted from samba? For example, to mount /usr/local/bin ? Using a different smb server, I've seen the ability to do this by doing something like Connect to: \\smbserver\/usr/local/bin Connect as: user Password: **** In other words, I'd like to be able to specify the exact path I'd like to mount without having to explicity put it in smb.conf. (Permissions would of course be subject to whatever the permissions the user has in unixland). If this isn't currently possible, could it be placed on the features wishlist? Thanks. Steve
On Tue, 15 Dec 1998, Steve Hsieh wrote:> Hi all, > > Is it possible to specify an arbitrary unix directory to be mounted from > samba? For example, to mount /usr/local/bin ? Using a different smb > server, I've seen the ability to do this by doing something like > > Connect to: \\smbserver\/usr/local/bin > Connect as: user > Password: **** > > In other words, I'd like to be able to specify the exact path I'd like to > mount without having to explicity put it in smb.conf. (Permissions would > of course be subject to whatever the permissions the user has in > unixland).It can be done, but it's not generally reccomended. IIRC, it involes putting "*" as the share name (or or the path or something like that) and using _'s instead of /'s (ie "\\smbserver\_usr_local_bin_"). It's in John Blair's samba book. -- Scott D. Webster swebster@carroll.com Etc Services Voice: 201.385.7113 Linux, Unix, & TCP/IP Network Consulting Pager: 800.379.2402
If I remember correctly, use path=/%S and then send a request for a service like \\server\usr_local_bin which is converted by samba to usr/local/bin. I can't get to the machine I'm using this on right now, so you may need to twiddle with it a bit. There may have been more things I needed to set up (it's been a few years since I changed the configs on that machine). My memory stinks, so I may be way off... Check `man smb.conf` Optionally, you could share the root filesystem with path=/ and then use smbclient with the -D option to specify a starting directory. This would be more useful from a script I should think. smbclient '\\server\root' -D '/usr/local/bin' -c 'get filename' On Tue, 15 Dec 1998, Steve Hsieh wrote:> Hi all, > > Is it possible to specify an arbitrary unix directory to be mounted from > samba? For example, to mount /usr/local/bin ? Using a different smb > server, I've seen the ability to do this by doing something like[Darrin] -- "I have no special gift. I am only passionately curious." - A. Einstein Darrin M. Gorski, Research Computer Systems Network Support Scientific Research Laboratories, Ford Motor Company Internet: dgorski@ford.com | Tel/Fax: +1 (313) 248-3753
On Tue, Dec 15, 1998 at 07:28:51PM +1100, Steve Hsieh wrote:> Hi all, > > Is it possible to specify an arbitrary unix directory to be mounted from > samba? For example, to mount /usr/local/bin ? Using a different smb > server, I've seen the ability to do this by doing something like > > Connect to: \\smbserver\/usr/local/bin > Connect as: user > Password: **** > > In other words, I'd like to be able to specify the exact path I'd like to > mount without having to explicity put it in smb.conf. (Permissions would > of course be subject to whatever the permissions the user has in > unixland). > > If this isn't currently possible, could it be placed on the features > wishlist? > > Thanks. > SteveHi You could just make a share named e.g. root with "path = /". Then you could mount it with \\server\root\usr\local\bin This is not exactly what you want, but quite close I guess.. mfg, fgp
Thank you to everyone who responded to this. A couple of followup questions if you don't mind (since I currently don't have the book that apparently is well recommended) 1. Is there a reason why '_' is used instead of '/'? 2. What kind of security implications are there? What additional risks are there that make this more risky than a regular unix user accessing an arbitrary directory? Thanks, Steve On Tue, 15 Dec 1998, Scott D. Webster wrote:> On Tue, 15 Dec 1998, Steve Hsieh wrote: > > > Is it possible to specify an arbitrary unix directory to be mounted from > > samba? For example, to mount /usr/local/bin ? Using a different smb > > server, I've seen the ability to do this by doing something like > > > > Connect to: \\smbserver\/usr/local/bin > > Connect as: user > > Password: **** > > > > In other words, I'd like to be able to specify the exact path I'd like to > > mount without having to explicity put it in smb.conf. (Permissions would > > of course be subject to whatever the permissions the user has in > > unixland). > > I just looked this up in John Blair's Samba book (ISBN: > 1-57831-006-7). The way to do this is to set this up in [global]: > > default service = wildcard > path = /%S > > This will cause \\server\usr_local to mount /usr/local. Use this > with caution as there are serious security implications. > > -- > Scott D. Webster swebster@carroll.com > Etc Services Voice: 201.385.7113 > Linux, Unix, & TCP/IP Network Consulting Pager: 800.379.2402 >