On the FreeBSD servers, there was a straightforward way to limit permissions for users on a virtual server – on Textdrive we called it “jailing”. Due to particularities with the way Solaris handles directory listing, the old method doesn’t work on Solaris shared, and if you give SFTP permissions to a user on a virtual server, they have pretty much free reign to browse around the directories of your account. They can’t change any files, but they can ls to their hearts’ content.
This is one method of providing SFTP access to a user so they can update a website freely, while limiting their read access to the rest of your shared server.
I use this as a method of preventing an implicitly trusted user (a family member) from seeing everything on my server. Because of the configuration involved, this is not a completely secure solution (see drawbacks below).
We’ll call your user Jill, the domain jilldomain.com, and the new FTP user webuser.
Now the web page for this domain will be served from that directory. Careful here, if you point apache to a non-existent directory, chaos will ensue.
Ok, right now webuser can fire up SFTP and browse directories all around your server, even on other virtual domains – though she doesn’t have write permissions outside of her home directory.
ssh to your server. you’re going to change some directory permissions:
% chmod go-r /users/home/yourserver % chmod go-r /users/home/yourserver/* % chmod go-r /users/home/yourserver/domains % chmod go-r /users/home/yourserver/domains/*
Now webuser can’t go browsing around directories. This also means that you need to set the sftp directory manually for webuser. In most FTP programs there’s a setting like “initial path” – set that to something like /users/home/yourserver/domains/jilldomain.com/homes/webuser/web. Otherwise, SFTP seems to balk (apparently trying to ls first before being re-directed to the SFTP user’s home).