We have a VPS server with a prod and dev version of web aplication. Also there are two ssh accesses - users cst-prod and cst-dev. Problem is, some developers under me keep changing things in /home/www/prod althrough they use dev access. Only I have password from prod ssh account. But it doesn't mean anything if the dev account can access prod directory. So I want to restrict this account so it can only access /home/www/dev directory, or at least cannot access /home/www/prod. Unfortunately I don't have a sudo access to server. But prod account is the owner of prod directory. It there a simple and celan solution for this?
1 Answer
It depends on whether they use group access or other access to change files there.
chmod -R g-w /home/www/prod
will prevent anyone from the group to change files
chmod -R o-w /home/www/prod
will prevent all users who are not owner or in a group to change files.
But before you do this, make sure nobody else needs write access to this directory, it really depends on your use case.