3

I have a user named "ftp3" that belong to group "ftpusers-temp".

The home of that user is home/FTP-shared/temp

In proftpd.conf I have the following 2 directives:

DefaultRoot /home/FTP-shared
DefaultRoot ~ ftpusers-temp

I was expecting that user ftp3 could see only the "temp" directory; but what happens is that the "temp" directory is selected by default upon login, but the user can go back and access the root of the ftp server.

Shouln't user "ftp3" be jailed in "/home/FTP-shared/temp", and unable to access "/home/FTP-shared"?

3

The DefaultRoot line needs to be at the end of the configuration file.

2

I believe the problem could be that you have multiple DefaultRoot(s) specified. As the ProFTPd documentation explains:

If two DefaultRoot directives apply to the same user, ProFTPD arbitrarily chooses one (based on how the configuration file was parsed)

You could try commenting out the first DefaultRoot directive and see if that helps to resolve the problem.

1

edit

This is a method of jailing users in their own home directory.

  • This is an standard function in ProFTPd
  • Open /etc/proftpd/proftpd.conf
  • Uncomment #DefaultRoot ~
  • replace with DefaultRoot /home/someuser someuser

(Let’s quickly explain the line above. DefaultRoot is the parameter used by proftpd to enable the jail functionality. someuser is the primary group of all users being chrooted (by default this is the same as the username). /home/someuser is the directory where the user will be jailed.)

  • Then execute "/etc/init.d/proftpd restart"
  • 1
    Thanks for the answer, but I've already tried that and didn't work. – pvieira Jun 23 '10 at 8:51
1

I think that best option in your case will be jail users in their directories. You can use the little known %u variable. Documentation seas:

It will be substituted, during the handling of an FTP session, with the name of the user who logged in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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