Centos SSH & SFTP user restriction to specific directories
0
votes
1
answer
206
views
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
, python
etc.
- Access home directory (devel
) with full permissions (rwx
)
- Access a mounted Hard Drive /mnt/dataspace
with full permissions (rwx
)
- Access the /usr/lib
, /usr/src
and some other directories with full permissions (rwx
)
I want to prevent devel
from:
- Accessing all other directories such as /
, /boot
, /etc
, /opt
, /var
etc.
- Accessing certain services/deamons such as httpd
, sshd
, mysqld
etc.
- 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.
Asked by Raja Ayaz
(1 rep)
Nov 21, 2019, 08:03 PM
Last activity: Nov 21, 2019, 10:56 PM
Last activity: Nov 21, 2019, 10:56 PM