Page 1 of 1

How do I use a mount command with the file security permissions?

Posted: 22. Feb 2017, 05:28
by GeorgeRT
I have used the mount command to support a file share between a Windows host and a Linux guest.

How would I use a mount command like this with the "mode=0700" option?

Code: Select all

mount -t vboxsf -o uid=26,gid=26 mode=0700 foobar /mnt/windows-share
I tried the above command with different locations of "mode=0700" with no quotes. It never worked.

Does the vboxsf file system not support such octal security permissions?

Re: How do I use a mount command with the file security permissions?

Posted: 22. Feb 2017, 14:39
by Martin
vboxsf doesn't support this. You need to use a "real" Windows share over the network.

Re: How do I use a mount command with the file security permissions?

Posted: 22. Feb 2017, 14:53
by socratis
According to the user manual, Ch. 8.32 VBoxManage sharedfolder add/remove:
-readonly Specifies that the share has only read-only access to files at the host path.
By default, shared folders have read/write access to the files at the host path. More specifically, on Linux distros - shared folders are mounted with 770 io permissions with root user and vboxsf as the group, and using this option the io permissions change to 700. Optional.
The "-readonly" is equivalent to checking the Read-Only option in the GUI. See if that helps.

To tell you the truth, 700 doesn't seem to be the right octal permissions in the manual, it seems to me that it should be more like 550 if it's a read only share, but it could be something wrong with the documentation.

Re: How do I use a mount command with the file security permissions?

Posted: 23. Feb 2017, 17:17
by GeorgeRT
I can use a different octal value than 700. How do I use a regular Windows file share? I was able to get Samba client installed on my Linux guest. I was able to use it interactively with get and put commands to transfer files to and from my Windows desktop host. I do not see how to use Samba for non-interactive usage (e.g., mount a regular file system that is a Windows file share).

I know how to create Windows file shares. I know how to mount file systems in Linux. How do I mount a regular file system in Linux that is supported by a Windows file share?

Re: How do I use a mount command with the file security permissions?

Posted: 24. Feb 2017, 01:57
by socratis
GeorgeRT wrote:How do I mount a regular file system in Linux that is supported by a Windows file share?
I'm not sure I understand the question. No, scratch that, actually I'm sure I don't understand the question.

On my Mint VM I can go to "Network", look under the "Windows network" and I can see my Windows shares. I'm sure something like that exists for your Linux distro (you never divulged that information). You might be able to find a good tutorial on the webs...

Re: How do I use a mount command with the file security permissions?

Posted: 24. Feb 2017, 10:43
by Martin
GeorgeRT wrote:I know how to create Windows file shares. I know how to mount file systems in Linux. How do I mount a regular file system in Linux that is supported by a Windows file share?
Have look at https://www.samba.org/samba/docs/man/ma ... ifs.8.html and go from there... ;)

Re: How do I use a mount command with the file security permissions?

Posted: 24. Feb 2017, 14:30
by socratis
Martin wrote:and go from there...
Go from there? But, that's the mother lode! The tree of knowledge! The fountain of SaMBa! Where do you go from there? :D

Re: How do I use a mount command with the file security permissions?

Posted: 24. Feb 2017, 18:46
by GeorgeRT
I reviewed the link.

I am running Linux CentOS 7.3 as a Guest. I have a Windows laptop (the Oracle VirtualBox host) with a windows file share named "foldera." The Windows laptop has an IP address of x.x.x.x. I have accessed it interactively from the CentOS 7.3 server with the smb client.

I try this command:

Code: Select all

mount -t cifs -o username=usera,password=$specialpassword //x.x.x.x/foldera /mnt/windows-share
But I get this error:
CIFS VFS: Error connecting to socket. Aborting operation.
CIFS VFS: cifs_mount failed w/return code = -115
mount: mount //x.x.x.x/foldera on /mnt/windows-share failed: Operation now in progress
What is wrong? I looked into this. I am not clear what I need to do to get this folder share to work.