每个用户的proftpd初始目录

成功设置proftpd服务器后,我想为每个用户添加初始目录,我有2个用户,webadmin可以访问所有文件夹和上传,只能访问上传文件夹

... # Added config DefaultRoot ~ RequireValidShell off AuthUserFile /etc/proftpd/passwd # VALID LOGINS <Limit LOGIN> AllowUser webadmin, upload DenyALL </Limit> <Directory /home/webadmin> <Limit ALL> DenyAll </Limit> <Limit DIRS READ WRITE> AllowUser webadmin </Limit> </Directory> <Directory /home/webadmin/upload> <Limit ALL> DenyAll </Limit> <Limit DIRS READ WRITE> AllowUser upload </Limit> </Directory> 

所有设置好,但我需要告诉我的FTP客户端初始目录为每个用户(否则它保持检索目录失败),我认为它应该为每个用户自动设置(不需要在FTP客户端键入初始目录)

它看起来像你设置他们的根目录到他们各自的主目录我build议在他们的主文件夹中添加一个符号链接到你想要他们指向的文件夹。 (如果你可以删除他们的主目录并将它们作为这些文件夹符号链接,也可能需要允许访问他们的主文件夹,但我不确定。

更新你可以使用两个虚拟主机分解这两个用户,然后设置每个默认的根。

 <VirtualHost my.per-user.virtual.host.address> # the next line limits all logins to this virtual host, so that only anonftp users can connect <Limit LOGIN> DenyGroup !anonftp </Limit> # limit access to each user's anon-ftp directory, we want read-only except on incoming <Directory ~/anon-ftp> <Limit WRITE> DenyAll </Limit> </Directory> # permit stor access to each user's anon-ftp/incoming directory, but deny everything else <Directory ~/anon-ftp/incoming> <Limit STOR> AllowAll </Limit> <Limit READ WRITE> DenyAll </Limit> </Directory> # provide a default root for all logins to this virtual host. DefaultRoot ~/anon-ftp # Finally, force all logins to be anonymous for the anonftp group AnonymousGroup anonftp </VirtualHost>