0

I need a little help with configuring Ubuntu Server 14.04, apache2 and SFTP for multiple separate users. Every user needs to have website in his home directory, for example: /home/user/public_html available using http://user.mydomain.com. Also every user must be able to make SFTP and SSH connection but access must be restricted to /home/user. I don't know if it matters but all users will be using php, mysql and git on their accounts.

I've tried a lot of tutorials to achieve what I need but none of them worked for me. Every time when one thing works well other breaks :/

I will be grateful for any kind of help with this. Links, documentation, books are welcome.

  • I feel it's better to tell what you tried and what didn't work rather than asking for a one size fits all solution. – Frederick Nord Jan 27 '15 at 12:40
0

Have you considered adding the users who need access to the www-data group? I am fairly certain that apache runs as www-data on Ubuntu 14.04. If you add the users to this group you wont have to mess with chmod on that folder - which always has the potential to break apps that are currently in use.

0

hi for me working in this way, first you need add users to a group "sftpgroup", later modify

nano /etc/ssh/sshd_config

and edit add this to config file

Subsystem sftp internal-sftp -f AUTH -l VERBOSE
Match Group sftpgroup
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no

later modify for write and access

sudo chown root /home/bob
sudo chmod go-w /home/bob
sudo mkdir /home/bob/writable
sudo chown bob:sftpgroup /home/bob/writable
sudo chmod ug+rwX /home/bob/writable

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.