我正在尝试让 chroot 与虚拟 Pure-FTPD 用户一起工作,但由于某种原因,它就是不起作用。
我更改了以下选项:
/etc/default/pure-ftpd-通用:
VIRTUALCHROOT=true
在/etc/pure-ftpd/conf/ChrootEveryone:
yes
并添加了一个具有主目录的虚拟用户,显示如下:
Login : <someuser>
Password : <foo>
UID : 1003 (ftpuser)
GID : 1003 (ftpgroup)
Directory : /home/<homedir>/./
我在这里遗漏了什么?
答案1
尝试从用户主目录设置 VIRTUALCHROOT=false 和“/./”。
/etc/default/pure-ftpd-通用:
VIRTUALCHROOT=false
cat /etc/pure-ftpd/conf/ChrootEveryone:
yes
重启的时候,存在-A选项:
/etc/init.d/pure-ftpd restart 重新启动 ftp 服务器:运行:/usr/sbin/pure-ftpd -l pam -O clf:/var/log/pure->ftpd/transfer.log -u 1000 -E-A-8 UTF-8 -B
/etc/密码:
test:x:1001:1001::/home/test:/bin/sh
Chroot 工作:
# ftp localhost
Connected to localhost.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 11:03. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (localhost:ooshro): test
331 User test OK. Password required
Password:
230-User test has group access to: test
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful
150 Connecting to port 40034
226-Options: -l
226 0 matches total
答案2
解决了。
事实证明我的 FTP 服务器是通过 inetd 运行的,而不是独立运行的。
在 inetd 模式下配置时,conf 目录似乎被忽略。