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 server and i give hosting to some users and i use the next command to create users and their ftp accounts: sudo adduser nameofthepage

This command creates a directory with the name of the page in the "/home" directory where users can put the files of their web pages.

But i have a serious problem, when users log in to the server with their ftp accounts they can go a directory up of the /home directory and see all the directories of the server, how can i limit it?

Thanks a lot.

share|improve this question

migrated from stackoverflow.com Apr 7 '11 at 21:59

This question came from our site for professional and enthusiast programmers.

1  
what ftpd are you using ? –  petrus Apr 7 '11 at 22:02
    
Normally what you want is achieved by a chrooted SFTP only setup or some restricted shell like rssh. Do you have to stay with a less secure FTP setup? –  Karol Piczak Apr 7 '11 at 22:14

3 Answers 3

If /home is owned by root, which it probably is... you can always revoke read access for "others" on the /home directory itself.

sudo chmod o-r /home
share|improve this answer

If your concerned about that level of access, you might be better off using some kind of chroot or jail for users. There's pam_chroot and rssh that can be used to restrict users, and I'm sure some more jail options as well.

share|improve this answer

Hey, you should use virtual users for that. Look at mysql-pam.d you could have one database for ssh/ftp/other logins + disk quota or anything else just in one table. Check yours architection and scalability.

share|improve this answer

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.