我正在尝试在运行Ubuntu 12.04的服务器上为虚拟用户设置VSFTPD.我已将服务器配置为允许虚拟用户登录,但我无法让它上传.我的vsftpd.conf如下:
listen=YES anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 anon_upload_enable=YES dirmessage_enable=YES use_localtime=YES xferlog_enable=YES connect_from_port_20=YES chroot_local_user=YES virtual_use_local_privs=YES guest_enable=YES guest_username=virtual user_sub_token=$USER local_root=/var/www/$USER hide_ids=YES secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=vsftpd rsa_cert_file=/etc/ssl/private/vsftpd.pem
/etc/pam.d/vsftpd包含:
auth required pam_pwdfile.so pwdfile /etc/vsftpd.passwd crypt=hash account required pam_permit.so crypt=hash
我设置了两个虚拟用户,其中一个与本地用户同名.它们每个都有一个目录在/ var / www /由’virtual’拥有.据我了解,当虚拟用户以这种方式登录时,它们将作为用户虚拟对系统显示.使用此配置,用户可以登录,但无法上载文件. /var/log/vsftpd.log中给出的错误是:
Tue Nov 20 19:49:00 2012 [pid 2] CONNECT: Client "96.233.116.53" Tue Nov 20 19:49:07 2012 [pid 1] [zac] OK LOGIN: Client "96.233.116.53" Tue Nov 20 19:49:11 2012 [pid 2] CONNECT: Client "96.233.116.53" Tue Nov 20 19:49:11 2012 [pid 1] [zac] OK LOGIN: Client "96.233.116.53" Tue Nov 20 19:49:11 2012 [pid 3] [zac] FAIL CHMOD: Client "96.233.116.53","/test.ppm 644"
我曾尝试以各种方式更改这些目录的权限,但似乎没有任何工作.我觉得它与权限有关.有任何想法吗?
问题可能是由目录权限引起的,我的vsftpd对我有用,如下所示:
anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES chown_uploads=YES xferlog_file=/var/log/vsftpd.log xferlog_std_format=YES ftpd_banner=Welcome to blah FTP service. ls_recurse_enable=NO listen=YES pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES