AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1139382
Accepted
justadev
justadev
Asked: 2019-05-01 03:20:09 +0800 CST2019-05-01 03:20:09 +0800 CST 2019-05-01 03:20:09 +0800 CST

无法使用 vsftpd 登录虚拟用户

  • 772

我知道以前有人问过它(例如这里),但我完全被卡住了,不知道如何让它工作。

我正在尝试设置几个 ftp 用户,每个用户都有自己的子文件夹(因此用户只能看到他的根文件夹,而没有其他内容)。

当前的问题是在filezilla上我得到

Command:    open "[email protected]" 22
Command:    Trust new Hostkey: Once
Command:    Pass: ******
Error:  Authentication failed.
Error:  Critical error: Could not connect to server

/etc/vsftpd.conf

listen=YES
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log
connect_from_port_20=YES
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/home/ftpmain/ftp/$USER
hide_ids=YES
guest_username=vsftpd
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
pasv_address=123.123.123.123
pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=50000
chroot_local_user=YES
chroot_list_enable=NO

/etc/pam.d/vsftpd

auth required pam_pwdfile.so pwdfile /etc/vsftpd/ftpd.passwd
account required pam_permit.so

user1 文件夹如下所示(在 chmod+chown 之后):

/home/ftpmain/ftp/user1$ ll
total 12
dr-xr-xr-x 3 root   root    4096 Mar 18 19:17 ./
dr-xr-xr-x 4 nobody nogroup 4096 Mar 18 19:09 ../
drwxr-xr-x 2 vsftpd nogroup 4096 Mar 18 19:17 folder1/

网络统计

$ netstat -tlpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -

关于我缺少什么以及如何使其发挥作用的任何想法?有没有办法调试它?一些日志文件,我可以检查为什么登录失败?

任何帮助将不胜感激,如果您需要更多信息,请告诉我

PS:在 ubuntu 18.04 上运行

更新

我在 /var/log/auth 文件中发现了这个错误:

$ tail -f /var/log/*

Apr 30 15:05:49 ip-172-31-40-232 sshd[25641]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=111.111.111.111
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: Failed password for invalid user user1 from 111.111.111.111 port 53251 ssh2
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: error: Received disconnect from 111.111.111.111 port 53251:13: Unable to authenticate [preauth]
Apr 30 15:05:51 ip-172-31-40-232 sshd[25641]: Disconnected from invalid user user1 111.111.111.111 port 53251 [preauth]

我发现 vsftpd 根本没有运行!我以前没有看到它的原因是因为我有 SFTP 工作(使用端口 22)。vsftpd 状态为“失败”。

$ sudo /etc/init.d/vsftpd status
● vsftpd.service - vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-04-30 15:45:56 UTC; 2s ago
  Process: 25980 ExecStart=/usr/sbin/vsftpd /etc/vsftpd.conf (code=exited, status=2)
  Process: 25972 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
 Main PID: 25980 (code=exited, status=2)

我从命令行手动运行 vsftpd 并发现存在证书错误

$ sudo /usr/sbin/vsftpd /etc/vsftpd.conf
500 OOPS: SSL: cannot load RSA certificate
vsftpd
  • 1 1 个回答
  • 2329 Views

1 个回答

  • Voted
  1. Best Answer
    justadev
    2019-05-01T09:37:54+08:002019-05-01T09:37:54+08:00

    我通过将证书添加到 conf 文件来解决此问题

    rsa_cert_file=/etc/ssl/private/vsftpd.pem
    rsa_private_key_file=/etc/ssl/private/vsftpd.pem
    
    • 2

相关问题

  • 如何在系统引导时加载 `vsftpd` 守护程序,但让它在“停止”状态下“启动”?

  • 如何让用户通过 FTP 登录?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve