TransWikia.com

How do I mount a filesystem without the mount point changing owner to root?

Super User Asked by PatMcTookis on November 12, 2021

I have two samba shares on a remote server (Debian 10, stable) on my home network. On my laptop (Debian 10 stable), I would like to automatically mount these shares to my local filesystem tree. To this end, I added these lines to my fstab file:

//cherver/sambaDocs /home/maquinisto/sambaDocs  cifs    credentials=/home/maquinisto/.smbcreds,user,rw  0 0
//cherver/sambaEtc  /home/maquinisto/sambaEtc   cifs    credentials=/home/maquinisto/.smbcreds,user,rw  0 0

My problem is that when fstab is read at boot or with sudo mount -a, the mount points change ownership to root, and I cannot write files there as a normal user. How do I mount these shares to my laptop system without the mount points changing owner to root?

One Answer

mount.cifs allows the options uid and gid to specify the user, who "owns" the file system.

In you case the options (credentials=/home/maquinisto/.smbcreds,user,rw) would need to be extended to include uid=xxxx and if you so wish gid=yyyy

Answered by Eugen Rieck on November 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP