我在 Rackspace 上有一个服务器,我想启用 FTP。但是,我无法启动该服务。在本地虚拟机上使用完全相同的设置(相同的发行版、内核、vsftpd 安装步骤和相同的配置文件 /etc/vsftpd.conf),它运行完美。
/etc/vsftpd.conf 的配置文件如下:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
#chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
似乎没有任何内容添加到日志文件中/var/log/vsftpd.log
我认为该服务永远无法正确启动,因为使用 nmap 时我永远看不到端口 21 打开,并且每当我执行 sudo service vsftpd restart 时,我都会得到stop: Unknown instance:
而不是vsftpd stop/waiting
。但是我从未看到任何类型的错误消息。
我检查了 /var/run/vsftpd/empty 目录以及 rsa 证书文件是否存在。
我还尝试暂时禁用 ufw 防火墙(尽管它已经允许端口 21)。
我是否需要检查其他权限/配置?
uname -a 输出:3.8.0-38-generic #56~precise1-Ubuntu SMP Thu Mar 13 16:22:48 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
更新
/var/log/syslog的输出如下:
3 12:35:15 annonymous kernel: [18271.505345] BUG: Bad page map in process vsftpd pte:8000000000000165 pmd:1b03f067
Apr 3 12:35:15 annonymous kernel: [18271.505358] page:ffffea0000000000 count:-174 mapcount:-174 mapping: (null) index:0x0
Apr 3 12:35:15 annonymous kernel: [18271.505367] page flags: 0x14(referenced|dirty)
Apr 3 12:35:15 annonymous kernel: [18271.505377] addr:00007f315f3bc000 vm_flags:00100071 anon_vma:ffff88001b0af180 mapping: (null) index:7f315f3bc
Apr 3 12:35:15 annonymous kernel: [18271.505389] Pid: 26581, comm: vsftpd Tainted: G B 3.8.0-38-generic #56~precise1-Ubuntu
Apr 3 12:35:15 annonymous kernel: [18271.505391] Call Trace:
Apr 3 12:35:15 annonymous kernel: [18271.505399] [<ffffffff8115c3a9>] print_bad_pte+0x1d9/0x270
Apr 3 12:35:15 annonymous kernel: [18271.505403] [<ffffffff8115e53e>] zap_pte_range+0x3de/0x440
Apr 3 12:35:15 annonymous kernel: [18271.505408] [<ffffffff81005dc0>] ? xen_make_pte+0x20/0x70
Apr 3 12:35:15 annonymous kernel: [18271.505412] [<ffffffff8100544d>] ? __raw_callee_save_xen_make_pte+0x11/0x1e
Apr 3 12:35:15 annonymous kernel: [18271.505415] [<ffffffff81005489>] ? __raw_callee_save_xen_pmd_val+0x11/0x1e
Apr 3 12:35:15 annonymous kernel: [18271.505419] [<ffffffff8115e766>] unmap_page_range+0x1c6/0x320
Apr 3 12:35:15 annonymous kernel: [18271.505424] [<ffffffff81142369>] ? __pagevec_lru_add_fn+0xb9/0xf0
Apr 3 12:35:15 annonymous kernel: [18271.505428] [<ffffffff8115e947>] unmap_single_vma+0x87/0x100
Apr 3 12:35:15 annonymous kernel: [18271.505432] [<ffffffff8115f204>] unmap_vmas+0x54/0xa0
Apr 3 12:35:15 annonymous kernel: [18271.505435] [<ffffffff8116756c>] exit_mmap+0x9c/0x170
Apr 3 12:35:15 annonymous kernel: [18271.505440] [<ffffffff8105788a>] mmput.part.22+0x4a/0x120
Apr 3 12:35:15 annonymous kernel: [18271.505444] [<ffffffff81057989>] mmput+0x29/0x30
Apr 3 12:35:15 annonymous kernel: [18271.505447] [<ffffffff8105fd3a>] exit_mm+0x10a/0x130
Apr 3 12:35:15 annonymous kernel: [18271.505451] [<ffffffff810fbd55>] ? taskstats_exit+0x45/0x270
Apr 3 12:35:15 annonymous kernel: [18271.505455] [<ffffffff816f66f5>] ? _raw_spin_lock_irq+0x15/0x20
Apr 3 12:35:15 annonymous kernel: [18271.505459] [<ffffffff8105fec3>] do_exit+0x163/0x480
Apr 3 12:35:15 annonymous kernel: [18271.505463] [<ffffffff8119c9e0>] ? vfs_write+0x110/0x180
Apr 3 12:35:15 annonymous kernel: [18271.505467] [<ffffffff81060274>] do_group_exit+0x44/0xa0
Apr 3 12:35:15 annonymous kernel: [18271.505471] [<ffffffff810602e7>] sys_exit_group+0x17/0x20
Apr 3 12:35:15 annonymous kernel: [18271.505475] [<ffffffff816ff25d>] system_call_fastpath+0x1a/0x1f
Apr 3 12:35:15 annonymous kernel: [18271.505560] BUG: Bad rss-counter state mm:ffff880004b48b40 idx:0 val:-1
Apr 3 12:35:15 annonymous kernel: [18271.585722] BUG: Bad rss-counter state mm:ffff880004b48b40 idx:1 val:1
Apr 3 12:35:15 annonymous kernel: [18271.597942] BUG: Bad page map in process vsftpd pte:8000000000000165 pmd:02463067
Apr 3 12:35:15 annonymous kernel: [18271.597962] page:ffffea0000000000 count:-175 mapcount:-175 mapping: (null) index:0x0
Apr 3 12:35:15 annonymous kernel: [18271.597973] page flags: 0x14(referenced|dirty)
Apr 3 12:35:15 annonymous kernel: [18271.597985] addr:00007fe0c9a67000 vm_flags:00100071 anon_vma:ffff88001b0af500 mapping: (null) index:7fe0c9a67
Apr 3 12:35:15 annonymous kernel: [18271.597999] Pid: 26584, comm: vsftpd Tainted: G B 3.8.0-38-generic #56~precise1-Ubuntu
我猜测坏页映射错误是由于我使用了大量内存并进入交换区而导致的?
答案1
最后我放弃了 vsftpd,转而使用 proftpd,它最终成功了。出于某种原因,proftp 无法在 inetd 模式下启动,我不得不将配置文件更改为独立模式。
这是我使用的教程安装 proftp 并且描述的“错误修复”在评论中