0

So here is the deal, I create directory /home/accounting, I have users donna and mike and I want to restrict read privileges for them to this directory.

After going to Google I was able to find how to change permissions by chmod for my user and my group, but I was not really able to find how I can specify user in that command.

Then I found the setfacl command, but not sure if it enables permission or not, for example these two commands::

setfacl -R -m u:donna:r /home/accounting
setfacl -R -m u:mike:r /home/accounting

Is this correct? Or there is another way of revoking read access?

2
  • What you're trying to do is called "chroot" or "jail", so you can look up details on how those work. You don't mention how they are accessing the files, EG: samba, nfs, shell, ftp, so it's hard to give you specific suggestions.
    – WarzauWynn
    Aug 8, 2022 at 16:41
  • The golden rule is: "Try to understand what you are doing". That means: Read the manual page for setfacl, chmod and getfacl before using those commands.
    – U. Windl
    Aug 19, 2022 at 0:51

1 Answer 1

0

If you wish to decline the read permissions to the directory /home/accounting you could use

chmod o-r /home/accounting

Where o stands for others, - is basically removing or decling and r is read permission.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .