I'm setting up local hosting, and I need to configure user system as on popular hosting providers.
For example: I create user 'user1' in group, for example, 'users'. And I gave him home folder
In some hosting providers, when we connect to our account via SSH of SFTP, we find ourselves in our home directory (in my case it's
/user/user1). But, we can't access to
/user folder. We can't access to
/var and other directories, but we can access to
/bin and other service directories.
Chroot is bad thing there, because if we use chroot, we need to copy all bin and some system files in our user folder (because user will use shell).
I only need to close access by user group to parent directory (
/user), some my folders (
/home) and other
/user/ folders, but give access to home directory (for user1 it is
How can I do this?
sudo chmod 000 /user sudo chmod 777 /user/user1
But when I tried to
cd /user/user1 I got "permission denied" error.
How to fix this mistake and configure this correct?