Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Ubuntu (Hardy) server which I am using to host multiple websites. All of the sites are stored in subfolders of a public_html folder for my main login to the server and accessed via a single SSH account.

I now have a website user who wants FTP (or similar) access to enable them to upload various files etc to the directory where their website is situated, however I still need the SSH account to have access to this directory as I may need to make changes using my master account.

Basically I want to create an FTP account (I have VSFTPD installed) for a user with the home directory inside my own user account but they should only be able to read/write to this folder or its subfolders but not go further up the directory tree.

How can I achieve this?

Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

you should probably look into moving your webroot out of your personal directory.

maybe a system wide directory, like /var/virtual/ and then have all the different sites located there, and configure apache to use virtualhost

then you can simply symlink (ln -s) the website in question to the new user's directory, and chown the files and directories so that he can manage them.

of course, you can do the symlink thing now, and change file ownership, even though the files are nested in your home directory. you just need to provide permissions for world to read to the directory in question, which it likely is, since apache hosts the files properly.

i.e. ln -s /home/user1/public_html/website /home/user2/website then, as root/with sudo, chown user2 -R /home/user1/public_html/website/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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