`
isiqi
  • 浏览: 16067421 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

ports方式安装 pure-ftpd

阅读更多

一、用ports方式安装
# cd /usr/ports/ftp/pure-ftpd/
默认ports安装pure-ftpd时不支持puredb
# ee Makefile
在CONFIGURE_ARGS中 加入 --with-puredb
# make WITH_LANG=simplified-chinese install clean
ee /etc/rc.conf 加入:pureftpd_enable="YES"
二、修改配置文件。
# cd /usr/local/etc/
# cp pure-ftpd.conf.sample pure-ftpd.conf
# ee pure-ftpd.conf
找到# PureDB /etc/pureftpd.pdb
把#去掉,路径改成你刚才建的/usr/local/etc/pureftpd.pdb
好了。就这么简单。就和系统帐号完全分离了。
三、加入系统用户
pw useradd ftp -g nobody -s /sbin/nologin -d /home/ftp/incoming //是系统的FTP帐号
-d后面目录不能空,这个帐号(只能这个名字)用于记录日志,
也可在/usr/local/etc/pure-ftpd.conf中修改SyslogFacility none
从而不允许ftp帐号登陆。
四、加入虚拟用户
1)# /usr/local/bin/pure-pw useradd youID -u nobody -g nobody -d /home
两次输入密码
2)更新数据库:
# /usr/local/bin/pure-pw mkdb /usr/local/etc/pureftpd.pdb
五、PURE_PW用法
# pure-pw useradd xcityr -f /usr/local/pureftp/etc/ftppasswd -u nobody -g nobody -d /data/web/xcity -m
---注:xcity :ftp用户
-f ftppasswd:存放用户密码信息的文件
-u 用户uid 一般是系统的一个用户,就是你的ftp用户的家目录的用户
-g 用户组id
-d 锁定用户在家目录
-m 使pureftpd.passwd写进pureftpd.pdb,使更改生效。
*修改用户: # pure-pw usermod --help
*删除用户: # pure-pw userdel <login> [-f <passwd file>] [-m]
*更改拥护密码:# pure-pw passwd <login> [-f <passwd file>] [-m]
*查看用户详细内容: # pure-pw show <login> [-f <passwd file>]
*生成db文件,使密码生效: # pure-pw mkdb [<puredb database file> [-f <passwd file>]]
*列出所有用户: # pure-pw list [-f <passwd file>]

出错了看:

Pure-ftpd: account disabled

I have configured pure-ftpd using FreeBSD ports(usually compiled from source). After everything have setup, postgresql, db, table, users and etc, it seem like cannot connect into the server with the below message…

Dec 19 16:34:14 server pure-ftpd: (?@202.181.206.234) [WARNING] Can’t login as [test]: account disabled

After few hours of checking, I found the cause of the problem is the UID and GID I set was low than 1000, if you have the similar problem, try to set a higer UID and GID. Better in the range of 5000(my own opinion).

All the best

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics