I mounted, in my local CentOS Samba server, a shared folder located in a computer in another town using a VPN connection, and I verified that I can create, edit and remove files and folders in that remote folder as if I was dealing with a directory in my own local Samba server.

And now comes my question: I would like to use my local Samba server to share this local mount so I could access it over the network from any Windows PC (I would access that remote share as if it was a local share), and I'm not finding references to it over the web; I wonder if it is possible at all in the first place.

This is the line on /etc/fstab (works fine):

 //ipaddress/share    /mnt/localdir    cifs   rw,file_mode=0777,dir_mode=0777,username=user,password=pass,noperm    0    0

When I create this new desired share on Samba and try to access it over the network it keeps asking me for user credentials, although the settings are identical to the settings of the other Samba shares that already work fine.

When I run the following commands, that I ran when creating the other Samba shares, this is what I get:

# chmod -R 0777 /mnt/localdir
chmod: changing permissions of ‘/mnt/localdir’: Permission denied

# chcon -t samba_share_t /mnt/localdir
chcon: failed to change context of ‘/mnt/localdir’ to ‘system_u:object_r:samba_share_t:s0’: Operation not supported

This is when I run "ls -l" to check permissions on the mounted local directory:

drwxrwxrwx. 2 root root 4096 Jul 20 10:50 localdir

I tried several options for the line of the /etc/fstab file, what I showed here is the current version.

To be honest, I'm not really worried about finding a solution, and I know I could just look for a way to access that remote shared folder in another town from my local computers using the VPN (although we don't want to make each other locations widely available to other computers): my main motivation now is sheer curiosity.

Please excuse-me for any formatting mistakes (my first post here), and thank you all in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.