Marc Chamberlin wrote:
I want to access the complete file systems of each computer via samba and autofs, which means I want to be able to access the "root" directory / on each system. Some years ago Samba stopped me from designating / as a samba shared directory and exporting it. (I don't understand why except from Googling it appears someone decided that to allow /, to be exported as a Samba share, was a security problem. I get so annoyed at all the layers of security and obfuscation so have not tried to track down what is exactly going on with Samba and the "root" / directory. Please don't try to dissuade me and tell me about the security risks of making the "root" / directory available for mounting, this is a SOHO network and I solely control all the computers on it.)
Fair enough - although I have to ask, why not use NFS?
I know Samba will allow me to define a share for the "root" / directory but it doesn't seem to work, at least autofs will not recognize/mount it and still reports the directory does not exist if I try to cd into it. So to work around this I do a bind mount of / as /slash and samba then allows me to export /slash as a samba share.
Does Samba actually complain when you define '/' as a share? it seems to me it ought to if it is not supported or enabled.
smb.conf has the following definitions for the root directory -
[slash] available = Yes browseable = Yes comment = Root directory inherit acls = Yes path = /
not "path = /slash" ?
This works fine for autofs and most tools that work on the host or across network file systems. All except, that is, the YaST2 partitioner. For some unknown reason it picks up the bind mount /slash and automagically reassigns all my mount points to be under /slash.
First thought - not unexpected, coz' /slash is /. Second thought - YaST probably could distinguish between the two.
So for example if I tell it to mount my home partition at /home the partitioner will reassign my mount point to be at /slash/home.
In 'expert' mode, I presume?
But without the bind mount defined in fstab, tools like autofs will no longer mount the "root" / directory though I do not grok why.
On the 'source' system, maybe set up an automount of / to /slash? I.e. only do the bind mount when /slash is needed? Ought to be dead easy with systemd automount.
Perhaps I am missing some magic trick or there is a better way to accomplish what I want to do, which ideally is to configure Samba to really share the "root" / directory.
I am no Samba expert (not at all!), but I think samba deals with users - maybe you need to force the user to be root when you define the share? -- Per Jessen, Zürich (12.1°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland.