Linux SFTP and many local user accounts, limits with mount --bind?

Posted by user123428 on Server Fault See other posts from Server Fault or by user123428
Published on 2012-06-04T07:58:25Z Indexed on 2012/06/04 10:44 UTC
Read the original article Hit count: 154

Filed under:
|
|

I am in the process of building a solution to handle many developers (possibly hundreds) to work on their files via sftp, each one Jailed in their home directory. For our particular needs, we have a samba mount point that contains all of the users home directories.

I have started developing the following solution and hit some walls: - I have configured a Ubuntu Lucid Server as sftp server. - In order to jail the user in their home directory (without allowing them the browse a directory up and seeing all the other users folders) I am using mount --bind and not a symbolic link (also some ftp clients don't really work with sym links). - The user accounts are local unix user accounts on the sftp server (not using a directory service or anything) that have an empty home folder created on the local machine, then I use mount --bind to bind the empty folder to the actual users home directory on the samba share.

With this solution I am hitting a couple of problems, in the case of a server reboot, all the mount --binds are lost because they are not written in fstab. Then I have read somewhere that the maximum amount of entries in fstab are 400 (which does not really help us).

I have thought of a solution of writing something that stores the mounts in a text file as a backup and on server reboot, run the script that re mounts.

I am just really unsure about this whole process and was wondering if anyone has any insight on possibly a better solution for SFTP? (not FTP)

© Server Fault or respective owner

Related posts about linux

Related posts about ftp