Ideally I would prefer it if server owners could NOT see their ‘system’ folders and scripts when they log in by FTP to their home directory. (Or at least not have permission to fiddle with them).
In other words, I’d like them to only have write access to their document root and their cgi-bin. Not to their mail files, their Awstats files etc (and I’d prefer it if the cgi-bin could be empty with a new site).
Does that make any sense? Can it be done quite easily? (I’m new to Virtualmin)
May I ask why you’d want to hide those files from the server owner? There’s nothing in there that’d have to be kept secret from him.
I don’t think VMin has functionality to do what you suggest… You’d have to fiddle manually with the ownership and permissions of the home directory contents. Which is not recommended, as it’d be prone to break a number of things.
What you could do is restrict FTP users to e.g. the public_html directory, causing them to see that as the “root” and not be able to changedir to anything outside that path. You can do that in Limits and Validation -> FTP Directory Restrictions.
May I ask why you’d want to hide those files from the server owner?
There’s nothing in there that’d have to be kept secret from him.
No, no secrecy. Just a case of thinking “need to know” basis is probably more stable. If someone can inadvertently delete or modify a system file, that has the potential to cause frustration and issues down the line.
What you could do is restrict FTP users to e.g. the public_html directory, causing them to
see that as the “root” and not be able to changedir to anything outside that path. You
can do that in Limits and Validation → FTP Directory Restrictions.
I have selected the server, and have set " Virtual server’s home directory". But it seems to have no effect.
(I dunno if that’s because I have changed the default home directory. At the same time, if I try to set the option “other directory”, nothing I enter there gets accepted. eg “httpdocs” (my renamed home directory) gets “Failed to save FTP directory restrictions : Missing or invalid directory in row 1”. Ditto with “/httpdocs”, or even “cgi-bin” or whatever).
BTW: Don’t mix up “home directory” with “HTML documents directory”.
The “home directory” is the one that contains all the stuff you wish to hide, like the Maildir etc. Your “httpdocs”, or originally “public_html” is not the home directory, that’s why setting the FTP restriction to “home directory” seems to have “no effect”. (In fact, it does have an effect. Without that restriction, FTP users can see the whole file system, or rather the parts they have access to.)
Actually, those settings look okay. To make sure the group assignment is correct, you can do groups test-domain.com. It should say then: something like test-domain.com : test-domain.com.
It might help to restart ProFTPD, maybe the config change has not yet been applied correctly.
Are you using Ubuntu? On my system, I got the issue that when Webmin restarts ProFTPD, the start fails cause the stop script returns before the server is actually down. It helps to append a ; sleep 3 to the shutdown command in the Webmin ProFTPD module config.
On my system, I got the issue that when Webmin restarts ProFTPD, the start fails
cause the stop script returns before the server is actually down. It helps to
append a ; sleep 3 to the shutdown command in the Webmin ProFTPD module config.
I have tried stopping, pausing and starting. No good!
Hmm okay… When you FTP in, and type pwd, what directory name does it tell you? And what does the ls listing show?
It’s possible that there’s an issue with Webmin/ProFTPD/Directory restriction (different config file layout or similar) on CentOS. For me on Ubuntu it works okay the way you have it set up now.