0

Firstly, I'll show you here my drive status, because I don't want to take just "don't use 777" answer.

Filesystem      1K-blocks     Used  Available Use% Mounted on
udev              3961312        0    3961312   0% /dev
tmpfs              798580     8916     789664   2% /run
/dev/sda2       122030736  4687540  111101356   5% /
tmpfs             3992888        0    3992888   0% /dev/shm
tmpfs                5120        0       5120   0% /run/lock
tmpfs             3992888        0    3992888   0% /sys/fs/cgroup
/dev/mmcblk0p1   15371584     6184   15365400   1% /boot/efi
/dev/sdb1      9688349816 18398760 9181614572   1% /NAS
/dev/sdc1      9688349816    81276 9199932056   1% /NAS2

as you can see, all of the best important are in sda1(wrote to tmpfs) and less but still important are in sda2

and now, I want to change my sdb1 and sdc1 's permission to 775 or 777, permanently.

I successfully link these two NAS folder to my windows main PC, and I grab all of my garbage to /NAS/ and boom, permission denied occurred.

of course I made my /NAS/ to sudo chmod 777 /NAS/ but it just worked alone to make /NAS/folder_level_1/, if task made more folder in lv1, then lv2 or another lv1 folders has no permission.

so I re-change sudo chmod every time my windows pc made new folders in /NAS

I read Grant permission for new created files inside folder automatically, and tried it.

efirlus@Efirlus-NAS:~$ dpkg -s acl
Package: acl
Status: install ok installed
Priority: optional

efirlus@Efirlus-NAS:~$ getfacl /NAS/samba/
getfacl: Removing leading '/' from absolute path names
# file: NAS/samba/
# owner: nobody
# group: nogroup
user::rwx
user:nobody:rwx
group::rwx
group:nogroup:rwx
mask::rwx
other::rwx
default:user::rwx
default:user:nobody:rwx
default:group::---
default:group:nogroup:rwx
default:mask::rwx
default:other::---

efirlus@Efirlus-NAS:~$ setfacl -m "o:rwx" /NAS/samba/

and it didn't work.

P.s I set up my nas followed to https://www.fosslinux.com/8703/how-to-setup-samba-file-sharing-server-on-ubuntu.htm


Rinzwind gave me a post exactly same problem as me. Thanks very much, but unfortunately it wasn't worked.

I followed his guide Grant permission for new created files inside folder automatically like

efirlus@Efirlus-NAS:~$ sudo setfacl -d -m u::rwx,g::rwx,o::rwx /NAS/samba
efirlus@Efirlus-NAS:~$ sudo getfacl /NAS/samba/
getfacl: Removing leading '/' from absolute path names
# file: NAS/samba/
# owner: root
# group: root
user::rwx
group::r-x
other::rwx
default:user::rwx
default:group::rwx
default:other::rwx

as you can see, there are default options, exactly 777

however when i drag my folders to z drive(it mounted in windows), permission error occurred.


I found this post in google https://unix.stackexchange.com/questions/98007/how-do-i-set-permissions-recursively-on-a-dir-with-acl-enabled

it worked!

Now I accept Rinzwind's advice, I'll set my acl to rwx, r-x, r--

0 Answers0