1

I have my AuthUserFile located at /etc/proftpd/proftpd.passwd. DefaultRoot is ~. This file currently lists a single user (username, password hash, home directory). How do I change a home directory for this virtual user?

interphx
  • 121
  • 1
  • 5

1 Answers1

1

It turns out that simply modifying the file (e.g. using sed) is enough to make the necessary change:

sed -i -e 's@/old/home/path@/new/home/path@' /etc/proftpd/proftpd.passwd

The changes are applied after ProFTPD restart, e.g. service proftpd restart or another equivalent command.

It should be noted, however, that ProFTPD virtual users are linked with actual Unix users by the actual user's id (which is also stored in proftpd.passwd). The linked user should have the necessary permissions for the new home path. Alternatively, you may want to not only change the home path, but also link your virtual user to another actual user.

interphx
  • 121
  • 1
  • 5
  • Another possibility is to use the [`ftpasswd`](http://www.proftpd.org/docs/contrib/ftpasswd.html) tool, which ships with the ProFTPD source distribution, for managing entries in your `AuthUserFile`. – Castaglia Jul 07 '16 at 18:14
  • @Castaglia I am aware of the tool, but from the docs it seems like it has only `--change-password` option (not `--change-home`), and accepts `--home` only for newly created users. Please, correct me if I'm wrong. – interphx Jul 07 '16 at 19:08
  • I've filed [this ticket](https://github.com/proftpd/proftpd/issues/566) for enhancing `ftpasswd` to support this use case. Thanks! – Castaglia Aug 23 '17 at 16:27
  • No need to restart ProFTPD, `proftpd.passwd` home modifications are effective right away on my servers. – sglessard Nov 30 '21 at 17:04