Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know the DefaultRoot ~ setting that you can use to jail users into their home directories but I need to customize this.

When authenticating with proftpd I get the user's home-directory from ldap via auth-pam. I have no control over what the home-directory path will be but I need them to be on my glusterfs which is a fusemount I have in /mnt/glusterfs.

What I would love to have is that if I get a user's home as /some/directory that proftpd would jail them into /mnt/glusterfs/some/directory

So basically I'd like to have something like DefaultRoot /base/path/~

If you guys (and or gals) can think of any solution be it modifying code or whatever creative solution I'd be glad to hear it.

thanks in advance

share|improve this question

You can use following directives to create the base path for all the ftp-users. This will restrict users to this path only

LDAPGenerateHomedir on
LDAPForceGeneratedHomedir on
LDAPGenerateHomedirPrefix /mnt/glusterfs/some/directory/
share|improve this answer

If your users' normal home directories include the user name, e.g. "/home/foo" for user "foo", then you might be able to use something like this:

DefaultRoot /mnt/glusterfs/home/%u

That %u variable will be resolved to the authenticated user name.

Hope this helps!

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.