Go Premium for a chance to win a PS4. Enter to Win

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

How do I mount a samba share and have it use the same permissions as the original mount point?

I set up file share between my wife's vista box and my ubuntu box.  The only way I could get it to work was to use the mount command and mount her share on my machine, using a blank mount point.  I set up the mount point as rwxrwxrwx  

The only way I can get the mount command to work is as root.  It mounts correctly but the permission are drwxr-xr-x.  That means I can only write to that directory as root.  Bumer.

I tried "sudo mount -t smbfs -o username=ken -o mode=777  //172.16.1.34/KenShared /home/ken/vista", but it keeps mounting it as 755 (rwxr-xr-x).

Is there anyway to tell samba to mount it using the original mount point permissions or force it to mount as 777?

Thanks for your help

0
KenSpeedie
Asked:
KenSpeedie
  • 3
  • 2
1 Solution
 
KenSpeedieAuthor Commented:
Tanks for you help.
0
 
MysidiaCommented:
Edit  /etc/fstab

//172.16.1.34/KenShared  /home/ken/vista  cifs   username=ken,user,noperm,noauto,dir_mode=777,file_mode=777    0 0

(This is all one line  with spaces between  "cifs"  filesystem type
and the filesystem options)


then use:
mount /home/ken/vista
0
 
KenSpeedieAuthor Commented:
Out of curiosity I ran your solution from the command line and got -

WARNING: 'dir_mode' not expressed in octal.
WARNING: 'file_mode' not expressed in octal

It mounted peoperly but with dr----x--t permissions.

I edited fstab, rebooted, and ran "mount /home/ken/vista"  and got the same thing.

Obviously it misread the mode settings.  How do I express the modes in octal?

Also it will only work as root.  Mounting as user gives me permissions error.  After it is mounted, owner and user get changed to root:root.  That will not be a problem if we can get universl permissions or at least so that I can have rw permissions.













































0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
woolmilkporcCommented:
Please try 0777!
0
 
MysidiaCommented:
Oh.. sorry about that.  

Octal file permissions are indicated by a leading 0, this is just like the chmod command:

//172.16.1.34/KenShared  /home/ken/vista  cifs   username=ken,user,noperm,noauto,dir_mode=0777,file_mode=0777    0 0

0
 
KenSpeedieAuthor Commented:
Solution was corrrect except I did not know how to format permission codes in octal.  Mysidia told me how to do that.

Thanks for the help.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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