I'm trying to setup new users for a particular directory but I want them to be able to see just one directory (and subfolders).
I have a server that has the following directories:
apache-user www-data /var/sites/mercury.solar-domain.com apache-user www-data /var/sites/venus.solar-domain.com apache-user www-data /var/sites/earth.solar-domain.com apache-user www-data /var/sites/mars.solar-domain.com apache-user www-data /var/sites/jupiter.solar-domain.com apache-user www-data /var/sites/saturn.solar-domain.com apache-user www-data /var/sites/uranos.solar-domain.com apache-user www-data /var/sites/neptune.solar-domain.com
I want to add a new user:
jupiter that could:
- Login to the server through ssh
- Is able to run via ssh
$ mysql -u jupiter -p)
- The only visible directory for the user is: /var/sites/jupiter.solar-domain.com
- When the user logs in (through ssh) he can not go to another directory of the system (/usr, /root, /var/log, etc...)
I have checkout
restricted shell but I don't think that their are the proper tool for me (or maybe I don't know how to configure them).
With chroot the problem is that I cannot change the user:group of the directory, for example:
apache-user www-data /var/sites/jupiter.solar-domain.com will have to stay the same, I can add
jupiter to the
www-data group but I can not change the user:group of the folder.
With restricted shell looks like the user will only able to use a restricted set of commands like scp, sftp, rsync, cvs and rdist, but I want them to be able to use mysql and php.
Thank you very much for your guidance on how to solve the problem.