[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

smbmount : How do file / directory permissions work ?

I am relatively new to using the smbmount command and accessing SAMBA shares via a Linux client.  I want to better understand what happens to file / directory permissions when a smb share is mounted.  Can anyone provide a brief explanation?  Thanks!

0
fatzjenkins
Asked:
fatzjenkins
  • 2
2 Solutions
 
w00pieCommented:
well it inherits read/write from the share itself, if the share is setup to allow users to write to it, then it with generally be mounted rw  if not ro
you can change the owner its mounted as if you want to keep other people out with different mount commands or mount it under a directory that has the permissions to keep people out
such as
mkdir -a /smbshares/somesharename
chmod smbshares 700

you can use mount to specifiy smbfs paritions also
mount -t smbfs -o username=<user>,password=<passwd> -U <uuid of user to mount as> //machine/share  /mntpnt

0
 
fatzjenkinsAuthor Commented:
Anytime I mount a share, I lose the owner / group information from the server.  For instance, if a directory has a share with the following permissions on the smb server :

owner : myname
group : mygroup

Once I mount it on the client, the permissions are changed to :

owner : 502
group : users

502 is the UID number on the server that is associated with MYNAME.  Is there a way to have MYNAME translated correctly to the client instead of the UID number for MYNAME?  Can I do the same for the group? Thanks!



0
 
jlevieCommented:
The information associated with the mounted data is the numeric UID & GID since that's how it is stored in the file system. Only if that matches local usage will you see the same user and group name.
0
 
w00pieCommented:
use the -U cmd and then the user id # for user you want to mount as
it won't inherit the user permissions though but to my knowledge smbmount for windows shares didn't carry user id #'s for different files

if your mounting as NFS partition that's another story.  but should all be in the man pages

0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now