vsftpd配置user_config_dir后重启服务报错(错误码-2)问题求助
各位大佬好,我最近在配置vsftpd的user_config_dir选项时遇到了棘手的问题,想请大家帮忙排查下报错原因。
先贴一下手册里关于这个选项的说明:
The vsftpd manual describe how to deal with multiple users on the FTP server via an environment variable called user_config_dir :-
user_config_dir
This powerful option allows the override of any config option specified in the manual page, on a per-user basis. Usage is simple,
and is best illustrated with an example. If you set user_config_dir to
be /etc/vsftpd_user_conf and then log on as the user "chris", then
vsftpd will apply the settings in the file /etc/vsftpd_user_conf/chris
for the duration of the session. The format of this file is as
detailed in this manual page! PLEASE NOTE that not all settings are
effective on a per-user basis. For example, many settings only prior
to the user's session being started. Examples of settings which will
not affect any behviour on a per-user basis include listen_address,
banner_file, max_per_ip, max_clients, xferlog_file, etc.Default: (none)
按我的理解,操作逻辑应该是这样的:在/etc下创建一个目录,把这个目录名赋值给vsftpd.conf里的user_config_dir参数,然后在这个目录下创建以用户名为名称的子文件夹,再把对应用户的专属配置放进这些子文件夹里。
但实际操作后完全行不通!只要我在vsftpd.conf里加上user_config_dir=/etc/vsftpd_user_conf,并且在这个目录下为user1和user2创建了子文件夹,重启vsftpd服务就会报错,我记得错误码是-2,服务直接启动失败。
我翻了好多资料,都没找到这种配置分离方法的详细指南或者可用示例,说实话挺惊讶的,vsftpd的开发者居然没把这块文档做得更完善点。
目前这个问题还不算特别紧急,因为到现在我所有vsftpd账号都用同一个SSL证书也能正常传输——不管是明文还是加密FTP,用办公电脑上的FileZilla 3.58连接都没问题,只要不配置user_config_dir就一切正常。不过以后要是能给不同账号配置不同的参数肯定会更灵活。
对了,我的服务器是OVH的Ubuntu 22.04,平时用SSH从办公电脑登录管理。
有没有大佬能帮我分析下报错的原因呀?
备注:内容来源于stack exchange,提问作者Trunk

