与12.04的VSFTPD配置问题
所以我今天将我的Ubuntu服务器升级到12.04 LTS,现在VSFTPD无法正常工作。 我认为这与VSFTPd在更新后停止工作有关
但是,与该post中的提问者不同,我没有收到任何错误消息。 当我登录时,我明白了
220 (vsFTPd 2.3.5) 331 Please specify the password. Password: 530 Login incorrect. ftp: Login failed
我知道密码是正确的,我尝试过多个用户。 vsftpd.log只显示以下内容:
Tue May 1 15:19:48 2012 [pid 2] CONNECT: Client "192.168.1.133" Tue May 1 15:19:53 2012 [pid 1] [USERNAME] FAIL LOGIN: Client "192.168.1.133"
Syslog什么都没有显示。 这是我的VSFTPD.conf(主要是默认值):
listen=YES anonymous_enable=NO local_enable=YES check_shell=NO write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=YES xferlog_enable=YES connect_from_port_20=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=vsftpd rsa_cert_file=/etc/ssl/private/vsftpd.pem
我尝试上一个问题中提到的命令无济于事。
sudo chmod aw /home/user
谢谢,谢谢你的帮助!
在vsftpd.conf中
进行以下更改:pam_service_name = ftp
保存更改并重新启动ftp服务器。
有几个原因你可能会得到这个理由。
防火墙 – >> Tcp_wrapper – >> PAM – >> SElinux – >> FTPService – >>文件。
-
首先在/ etc / vsftpd / ftpusers / etc / vsftpd / user_list中检查给定用户是否被阻止
-
检查SElinux上下文或相同的布尔值。
-
签入PAM目录文件。 /etc/pam.d/vsftpd
auth需要pam_shells.so
如果用户没有在/ etc / shells中需要shell那么它将给出相同的错误检查getent passwd用户名匹配给定shell与/ etc / shells。
尝试首先通过firefox或浏览器登录FTP,因此您肯定会得到一个无法登录的响应。
这只是一个预测,以确认它本身是否是登录凭据。
似乎vsftp的当前pam配置包括要求在FTP用户的情况下要有一个有效的shell。
# Standard behaviour for ftpd(8). auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed # Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so. # Standard pam includes @include common-account @include common-session @include common-auth auth required pam_shells.so
你唯一要做的就是评论最后一行auth required pam_shells.so 。 所以这不是必需的。
或者为所有ftp用户添加登录信息。
当您松开拒绝文件时,更改其他注释中建议的名称是没有意义的。
如果运行amd64内核,则需要将以下内容添加到/etc/vsftpd/vsftpd.conf
seccomp_sandbox=NO
在建立FTP连接时需要注意协议连接。
这些连接响应用户的访问,并在当前用户通过身份validation时启用。
在FTP中,如果被动模式未激活,您将收到此错误。
下面的配置文件是根据vsftpd软件配置的,并且所有设置都已正确配置,同时没有错误。
主动,被动模式并允许防火墙端口。 2000至2500 / TCP
pasv_enable=Yes pasv_max_port=2500 pasv_min_port=2000
%100修复了Vsftpd配置文件:/etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all compiled in defaults. # # READ THIS: This example file is NOT an exhaustive list of vsftpd options. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's # capabilities. # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # # Uncomment this to allow local users to log in. local_enable=YES # # Uncomment this to enable any form of FTP write command. write_enable=YES # # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) local_umask=022 # # Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. #anon_upload_enable=YES # # Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enable=YES # # Activate directory messages - messages given to remote users when they # go into a certain directory. dirmessage_enable=YES # # The target log file can be vsftpd_log_file or xferlog_file. # This depends on setting xferlog_std_format parameter xferlog_enable=YES # # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=NO # # If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! #chown_uploads=YES #chown_username=whoever # # The name of log file when xferlog_enable=YES and xferlog_std_format=YES # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log #xferlog_file=/var/log/xferlog # # Switches between logging into vsftpd_log_file and xferlog_file files. # NO writes to vsftpd_log_file, YES to xferlog_file xferlog_std_format=YES pam_service_name=vsftpd pasv_enable=Yes pasv_max_port=2500 pasv_min_port=2000 tcp_wrappers=YES
完成所有这些设置后,请记住配置防火墙设置。
- TCP传入:2000至2500和21
- TCP传出:2000到2500和21
请记住,您不能使用ftp://进行root访问。 您必须使用sftp://来访问根。
FTP添加新帐户:
- adduser newftpuser
- passwd newftpuser
默认的ftp文件夹:
- /家/ newftpuser