Add/configure users to only access their sites via ssh/sftp?
1. Add a new user
2. Grant them SSH and SFTP access to only their home directory and their websites.
I host a number of client websites (e.g. /srv/www/myclient.com/public_html) on my Linode server. I now want to be able add users to my server who will have the ability to SSH ans SFTP into their websites. Being an infrequent Linux admin, I'd simply like to know how best to make this happen … and if there are any best practices I should follow in order to make sure things are as secure as possible with this scenario.
Thanks much - wg
5 Replies
This guide
Allowing SSH access would be considerably more involved. It requires that copies of all binaries and device nodes that the user may need be present under the user's home directory.
@Vance:
covers setting up SFTP jails. Note that you would need to set the appropriate home directory for the user with something like usermod -d /srv/www/myclient.com username first. The user's home directory, as well as the directories above it, must be owned by root and not writable by any other user or group. This guideAllowing SSH access would be considerably more involved. It requires that copies of all binaries and device nodes that the user may need be present under the user's home directory.
Thanks for the link … worked perfectly.
As I'm running on a LMEP stack, with all of my sites running under www-data:www-data, will I have any problems with these SFTP users uploading files that need to be served by Nginx given that the owner will be myser:myuser?
They will be uploading, for the time being, php, html, css, javascript files.
Thanks again.