You are not logged in.

#1 2009-09-23 20:03:30

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

limit samba mount in /etc/fstab to one user (chmod 700 basically)

In a nutshell, I want to limit a mount (samba mount) to be the equilivant of 700 so only the user who owns the mount can access it.  My /etc/fstab contains the following line which makes it 777 to all users:

//192.168.1.2/share /mnt/share-ro       cifs    credentials=/root/.smbpasswd 0 0

I've done this in the past using file_mode=0500,dir_mod=500,uid=100,gid=102 but I don't know the damn modes for the equilivant of 700.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2009-09-23 21:43:46

ckristi
Member
From: Bucharest, Romania
Registered: 2006-11-21
Posts: 225

Re: limit samba mount in /etc/fstab to one user (chmod 700 basically)

Add in the option area (after credentials=... separated by coma): uid=your_user_id (or 0, if you want only root access),fmask=7177,dmask=7077
fmask sets the umask for files, dmask for directories... so the files will be mode 600 and directories 700.


In love I believe and in Linux I trust

Offline

Board footer

Powered by FluxBB