免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4001 | 回复: 15
打印 上一主题 下一主题

[FTP] [求助]pure-ftpd下多用户多目录如何设置? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-13 09:22 |只看该作者 |倒序浏览
现在配置好了apache的虚拟主机,用户的个人主页目录在 /home/xxxx/public_html。
# apt-get install pure-ftpd-common pure-ftpd
# groupadd ftpgroup
# useradd -g ftpgroup -d /dev/null -s /etc ftpuser
# pure-pw useradd test1 -u ftpuser -d /home/ftpusers/test1
# pure-pw mkdb
# pure-pw show test1
Login              : test1
Password           : $1$1kZ6kZT0$R15KvB4dy39Tyk3eFqMeA0
UID                : 1001 (ftpuser)
GID                : 1001 (ftpgroup)
Directory          : /home/test1/./
Full name          :
Download bandwidth : 0 Kb (unlimited)

# cd /etc/pure-ftpd/auth
# ln -s ../conf/PureDB 50pure
# echo no > /etc/pure-ftpd/conf/PAMAuthentication
# echo no > /etc/pure-ftpd/conf/UnixAuthentication

用以上方法安装了 pure-ftpd 后,系统上找不到 /etc/pure-ftpd.conf 配置文件,在 /etc/pure-ftpd/conf 中也没有这个文件。

现在面临的问题是:

linux系统上本来没有 test1 用户,用 pure-ftpd 建立的虚拟用户 test1 在 /home 目录下没有自己的目录,于是我用 root 在 /home 下建立了一个 test1 文件夹,可是 test1 用户用 ftp软件连接上后,无法上传,新建 public_html 目录。请问:应该如何设置这个 /home/test1 的 属主 和 属性?(因为 test1 是虚拟用户,无法用 chown test1 /home/test1 )

目前的属性是
drwxr-sr-x   2 root   staff      48 2006-02-13 09:03 test1

[ 本帖最后由 nothing9 于 2006-2-13 09:24 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-02-13 09:47 |只看该作者

第一次实验失败

操作如下:
# cd /home
# chown ftpuser.ftpgroup test1
drwxr-sr-x   3 ftpuser ftpgroup    72 2006-02-13 09:27 test1

test1 可以正常使用 ftp软件上传,新建目录,但是建立的 public_html 文件夹下的网页,在 apache 中无法访问。

出现的提示是:
Not Found
The requested URL /~test1/index.html was not found on this server.

[ 本帖最后由 nothing9 于 2006-2-13 10:01 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-02-13 10:04 |只看该作者
pureftpd对于目录的权限控制不是很理想
我劝你还是放弃吧

论坛徽章:
0
4 [报告]
发表于 2006-02-13 10:10 |只看该作者
看看这个
http://www.jijiao.com.cn/fuwu/ftp/otherftpd/Doc/00000002.htm

pure-pw useradd test1 -u ftpuser -d /home/ftpusers/test1
你建的是虚拟用户,是由真实的系统用户ftpuser映射的
所以,要想test1可以上传,就要把/home/ftpusers/test1这个目录设置成ftpuser这个用户可写

论坛徽章:
0
5 [报告]
发表于 2006-02-13 10:11 |只看该作者
原帖由 盛世唐朝 于 2006-2-13 10:04 发表
pureftpd对于目录的权限控制不是很理想
我劝你还是放弃吧

同意。用proftpd吧

论坛徽章:
0
6 [报告]
发表于 2006-02-13 10:15 |只看该作者
原帖由 nothing9 于 2006-2-13 09:47 发表
操作如下:
# cd /home
# chown ftpuser.ftpgroup test1

test1 可以正常使用 ftp软件上传,新建目录,但是建立的 public_html 文件夹下的网页,在 apache 中无法访问。

出现的提示是:


用ftp新建的目录的权限是什么?pureftpd里有没有umask的设置?

论坛徽章:
0
7 [报告]
发表于 2006-02-13 10:16 |只看该作者

第二次实验失败

我用的是 debian ,apache 中的 user usergroup 都是 www-data,也许是这个和 pure-ftpd 中的 ftpuser ftpgroup 不一致,才引起 apche 无法访问的。

这次我的操作是:
# pure-pw useradd test3 -u www-data -g www-data -d /home/test3
# pure-pw mkdb
# pure-pw show test3
Login              : test3
Password           : $1$aCodOTI0$GviP3U5W6Iq8f/A11pnz51
UID                : 33 (www-data)
GID                : 33 (www-data)
Directory          : /home/test3/./
Full name          :
Download bandwidth : 0 Kb (unlimited)
Upload   bandwidth : 0 Kb (unlimited)
Max files          : 0 (unlimited)
Max size           : 0 Mb (unlimited)
Ratio              : 0:0 (unlimited:unlimited)
Allowed local  IPs :
Denied  local  IPs :
Allowed client IPs :
Denied  client IPs :
Time restrictions  : 0000-0000 (unlimited)
Max sim sessions   : 0 (unlimited)
# /etc/ini.t/pure-ftpd restart
# mkdir test3
# chown www-data.www-data test3

上传到 /public_html 的 index.html 还是无法在 apache 中访问,错误信息和2楼一样。

我实在是想不出哪里没设置好,请过来人指点,谢了先~~~~~~

论坛徽章:
0
8 [报告]
发表于 2006-02-13 10:19 |只看该作者
把apache的error_log里的信息贴出来看看

论坛徽章:
0
9 [报告]
发表于 2006-02-13 10:23 |只看该作者
[Mon Feb 13 09:34:49 2006] [notice] Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 mod_perl/1.29 configured -- resuming nor
mal operations
[Mon Feb 13 09:34:49 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Mon Feb 13 09:35:33 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:35:38 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:35:44 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1
[Mon Feb 13 09:35:45 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:35:57 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/gnu.jpg
[Mon Feb 13 09:35:57 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:56:57 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/
[Mon Feb 13 09:56:57 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:58:56 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/
[Mon Feb 13 09:58:56 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:58:57 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/
[Mon Feb 13 09:58:58 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:58:58 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/
[Mon Feb 13 09:58:59 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:59:48 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/
[Mon Feb 13 09:59:49 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:59:53 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/index.html
[Mon Feb 13 09:59:53 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:59:55 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/index.html
[Mon Feb 13 09:59:55 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico
[Mon Feb 13 09:59:56 2006] [error] [client 192.168.1.2] File does not exist: /var/www/~test1/index.html
[Mon Feb 13 09:59:56 2006] [error] [client 192.168.1.2] File does not exist: /var/www/favicon.ico

我用 test1 ,test2 和 test3 都试过,错误信息是类似的。

论坛徽章:
0
10 [报告]
发表于 2006-02-13 10:25 |只看该作者
原帖由 nothing9 于 2006-2-13 10:23 发表
[Mon Feb 13 09:34:49 2006] [notice] Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 mod_perl/1.29 configured -- resuming nor
mal operations
[Mon Feb 13 09:34:49 2006] [notice] Accept mutex: sysvse ...

这些信息不是跟这个相关的,再找找
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP