我知道这个问题已经被回答了几次,但是我尝试了所有的方法,但它仍然不起作用。
我试图创建用户,并将它们显示到一个特定的文件夹中,但是在ftp之后,我能够在树上看到例如'/‘文件夹及其内容。
我并不试图在PAM中使用“虚拟用户”,但是当前的问题是“身份验证失败”。
/etc/vsftpd.conf
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
secure_chroot_dir=/var/run/vsftpd/empty
ssl_enable=YES
allow_anon_ssl=NO
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
require_ssl_reuse=NO
ssl_ciphers=HIGH
user_sub_token=$USER
local_root=/home/bgftp/ftp/$USER
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=50000
chroot_list_enable=yes
pasv_address=[ip]
chroot_local_user=YES
hide_ids=YES
allow_writeable_chroot=YES
user_config_dir=/etc/vsftpd_user_conf
guest_enable=YES
virtual_use_local_privs=YES
pam_service_name=vsftpd
nopriv_user=vsftpd
guest_username=vsftpd
virtual_use_local_privs=YESvsftpd:版本3.0.3 ubuntu: 18.04
/etc/pan.d/vsftpd
auth required pam_pwdfile.so pwdfile /etc/vsftpd/ftpd.passwd crypt=2
account required pam_permit.so crypt=2/etc/vsftpd/ftpd.passwd格式为user:散列哈希是使用openssl passwd -1创建的,我手动复制了结果。
存在user1文件夹:
/home/bgftp/ftp/user1# cat /etc/vsftpd_user_conf/user1
local_root=/home/bgftp/ftp/user1/folder1目前的答复:
Status: Connecting to [ip]...
Response: fzSftp started, protocol_version=2
Command: open "user1@[ip]" 22
Command: Trust new Hostkey: Once
Command: Pass: ******
Error: Authentication failed.
Error: Critical error: Could not connect to server如果你需要更多的信息,就告诉我
发布于 2019-03-18 21:17:26
看上去你可能很困惑。vsftp程序是FTP服务器,因此它将监听您的连接的端口21(ftp)。您正在使用sftp客户端尝试连接到您的服务器,因此您正在端口22(ssh)上进行连接。
FTP和SFTP协议不兼容。
如果您想像上面那样使用vsftpd服务连接到服务器,则需要使用ftp客户端。您可能还需要打开相关的端口。
如果要使用sftp连接到服务器,则需要配置sshd服务以允许它。
https://serverfault.com/questions/958869
复制相似问题