0

I have recently set up a server on Ubuntu 12.04 . I have an mail server hosted on the same server.

Now, there are a number of users with email id at my domain who can ssh to my server to see the code. I wish to hide the public_html folder of my website with others.

I fear that if I simply change the permission of folder, it won't be accessible on the web also. So, what is the best way of removing access to those folders to the various users ?

Please comment if I am unclear in asking my doubt !

1 Answer 1

1

Assuming that you are only wishing the external users to have mail through your server, then I would also assume that they have no need to login to your server.

The obvious solution would be to modify your user's shell to be "/bin/false" or something like that so they are unable to log into your server. Having users with the ability to log in locally always opens you up for prying eyes like this.

If, however, you wish to make sure they do not have access to this one folder, the best thing to do is set the group ownership of that folder to be whatever group your webserver runs as (in my case, I think it's www-data - check your httpd.conf file to make sure). Keep yourself as the owner, and revoke permissions for all to have access.

So:

chgrp -R www-data public_html

chmod 0750 public_html

1
  • Thanks ! This is exactly what I was looking for. I got a detailed explanation here about /bin/false/ cyberciti.biz/tips/… for those who have similar problems Mar 25, 2013 at 23:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .