I am managing a server running Cantos 7. Some users login to the server via ssh/sftp for development. For them i have created a user devel. For security reasons, i need to confine them to certain directories. They should be able to:
- Run only basic commands such as
cd,ls,cp,cat,mv,mkdir,rmdir, etc. - Run programs such as
java,gcc,pythonetc. - Access home directory (
devel) with full permissions (rwx) - Access a mounted Hard Drive
/mnt/dataspacewith full permissions (rwx) - Access the
/usr/lib,/usr/srcand some other directories with full permissions (rwx)
I want to prevent devel from:
- Accessing all other directories such as
/,/boot,/etc,/opt,/varetc. - Accessing certain services/deamons such as
httpd,sshd,mysqldetc. - Running any command (other than the basic commands above) e.g.
systemctl.
I don't want these directories (e.g. /, /etc, /var etc.) to even show up to them, or at the very least disable access to them.
Is it possible to do? I have read many questions here and also many other articles, forums and blogs about ACL and Chroot Jail erc. such as this, this, this, this, this, this, this, this, this, this, this but none of them helped me to achieve what i need to do.
Any help or any suggestions will be highly appreciated, i desperately need help.