我想创建一个匿名 ftp。用户只能从 pub 目录上传和读取。操作系统是Unixware 71,ftp服务器是WU-FTPD。这是 ftpaccess 文件
#ident "@(#)unixsrc:usr/src/common/cmd/cmd-inet/usr.sbin/in.ftpd/ftpaccess /main/1"
#
# ftpd configuration file, see ftpaccess(4tcp).
#
loginfails 3
passwd-check trivial warn
class all anonymous,guest,real *
compress yes all
tar yes all
readme README* login all
readme README* cwd=* all
#banner /var/ftp/banner.msg
#message /var/ftp/welcome.msg login all
#message .message cwd=* all
#chmod no anonymous
delete yes anonymous,guest
#overwrite no anonymous,guest
#rename no anonymous,guest
#umask no anonymous
#limit all 5 Wk0900-1800 /var/ftp/toomany.msg
#limit all 20 SaSu|Any1800-0900 /var/ftp/toomany.msg
log commands anonymous,guest,real
log transfers anonymous,guest,real inbound,outbound
#path-filter anonymous,guest /var/ftp/filename.msg ^[[:alnum:]-._]*$ ^[.-]
#upload /home/ftp * no nodirs
#upload /home/ftp /pub/incoming yes ftp other 0444 nodirs
upload /home/ftp /pub yes ftp other 0755
这是具有 home/ftp 权限和所有者的目录
1737 0 dr-xr-xr-x 5 root root 96 Mar 29 03:44 /home/ftp/
41212 0 d--x--x--x 2 root root 96 Mar 29 03:19 /home/ftp/bin
41215 20 ---x--x--x 1 root sys 19904 Mar 29 03:19 /home/ftp/bin/ls
41214 0 d--x--x--x 2 root root 96 Mar 29 03:39 /home/ftp/etc
41216 2 -r--r--r-- 1 root sys 33 Mar 29 03:36 /home/ftp/etc/passwd
41217 2 -r--r--r-- 1 root sys 10 Mar 29 03:39 /home/ftp/etc/group
41219 0 drwxrwxrwt 2 root sys 96 Mar 29 03:44 /home/ftp/pub
41218 2 -rwxr-xr-x 1 ftp other 389 Mar 29 03:44 /home/ftp/pub/cast
服务器工作,我可以在服务器上以匿名方式上传文件“cast”。但如您所见,无法读取(如果您知道文件名,则可以读取)
ftp -n 192.168.0.133
Connected to 192.168.0.133 (192.168.0.133).
220 unixware1 FTP server (Version wu-2.6.2(2) Wed Dec 21 20:49:51 EST 2005) ready.
ftp> user anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230 Guest login ok, access restrictions apply.
ftp> cd pub
250 CWD command successful.
ftp> ls
227 Entering Passive Mode (192,168,0,133,245,145)
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
ftp> put cast
local: cast remote: cast
227 Entering Passive Mode (192,168,0,133,156,60)
150 Opening ASCII mode data connection for cast.
226 Transfer complete.
390 bytes sent in 2,5e-05 secs (15600,00 Kbytes/sec)
ftp> ls
227 Entering Passive Mode (192,168,0,133,209,31)
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
ftp> ls cast
227 Entering Passive Mode (192,168,0,133,95,177)
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
ftp>
在其他论坛上找到的解决方案 我不得不在 chroot ftp 中复制一个共享库。