-1

How to provide full access only to specified directory (/home/new_user/) which contains php-executable files which user can execute?

The user can't change directory :

ls -la /home

results in the error message "You haven't permissions"

AdminBee
  • 22,803
harp1814
  • 113
  • The bit at the end of your question "User can't see any other directories." is that a statement or another question. If another question, then it should be in another question. If a statement, then it needs elaborating (what does it mean?). Please edit question to resolve. – ctrl-alt-delor Feb 02 '20 at 12:06
  • 1
    What have you tried? What did not work? You are correct that chmod 777 will do it (However it is over kill, that gives permission to all users). Think about who the person is logged in as (what user?). Then configure it the same as if they were logged in via other means e.g. via console, or X11. It is exactly the same. – ctrl-alt-delor Feb 02 '20 at 12:04

2 Answers2

2

Check out ACLs (Access Control Lists), they allow finer grained access control than the rough owner-group-others Unix model. Not all filessytems handle them, though.

vonbrand
  • 18,253
0

You can use setfacl command for a specific folder and user.

for user;

sudo setfacl -Rm d:u:new_user:rwx /home

for group;

sudo setfacl -Rm d:g:new_user:rwx /home

for check permissions;

getfacl /home
Kusalananda
  • 333,661
adnan
  • 1