1

Currently, when user A logs in proftp, he comes at his home directory /home/A, when user B logs in proftp, he comes at his home directory /home/B. I want to let user A come at /dir1 and let user B come at /dir2, how can I do in proftpd's configuration file?

OldFart
  • 105
  • 6
peter
  • 93
  • 13
  • 1
    Symlinks could help, even if not applicavle to all situations... https://askubuntu.com/a/41201/638590 – OldFart Dec 07 '22 at 09:26
  • 1
    @OldFart That works! Thank you! – peter Dec 08 '22 at 10:58
  • It certainly isn't a 'solution' as it can increase confusion in the long run and with future server updates or worse, migrations. symlinks/hardlinks will almost always work as either a GREAT workaround or a very CRUDE and dodgy one. Workaround nonetheless when it comes down to this specific situation. Bounty them points to whomever's solution i pasted - felt it was best to paste something that was relevant rather than just add 'try symlinking'. Anyways, glad it worked out, edit your question to add your solution for further reference... – OldFart Dec 08 '22 at 15:54

1 Answers1

0

You can specify the home directory for each user in the proftpd configuration file. To do this, you would need to add a DefaultRoot directive to the configuration file, specifying the directory that each user should be placed in upon login. For example:

# This directive specifies the directory that user A should be placed in
# upon login.
<User A>
  DefaultRoot /dir1
</User A>

# This directive specifies the directory that user B should be placed in
# upon login.
<User B>
  DefaultRoot /dir2
</User B>

You would then need to restart the proftpd service in order for the changes to take effect.

TheTanadu
  • 133
  • 1
  • 7
  • I cannot start proftpd with the directive: fatal: unknown configuration directive ''. There does exist a line in proftpd.conf: "User nobody", but that means "Set the user that the server runs as nobody". – peter Dec 05 '22 at 07:18