Linux下pure-ftpd服务553错误解决办法

只写操作步骤

1、安装Pure-FTPd
sudo apt-get install pure-ftpd-mysql mysql-server

1、运行sudo apt-get install pure-ftpd-mysql,如果未安装mysql的请运行sudo apt-get install pure-ftpd-mysql mysql-server

2、添加用户和组
sudo groupadd -g 2001 ftpgroup
sudo useradd -u 2001 -s /bin/false -d /dev/null -c "pure-ftpd user" -g ftpgroup ftpuser

2、sudo useradd -u 2001 -s /bin/false -d /dev/null -c "Pure-FTPd User" -g ftpgroup ftpuser

3、Chroot设置
sudo sh -c "echo 'yes' > /etc/pure-ftpd/conf/ChrootEveryone"

3、 sudo sh -c "echo 'yes' > /etc/pure-ftpd/conf/ChrootEveryone"把所有FTP用户困在这个目录下。

4、手工创建用户目录
sudo sh -c "echo 'No' > /etc/pure-ftpd/conf/CreateHomeDir"

4、sudo sh -c "echo 'No' > /etc/pure-ftpd/conf/CreateHomeDir"

5、为Pure-FTPd创建MySQL数据库
mysql -uroot -pxdnice -e "create database ftpusers;"

5、为Pure-ftpd创建mysql数据库ftpusers并创建数据表

创建数据库用户ftpadmin赋予权限
grant select,insert,update,delete,create,drop on ftpusers.* to 'ftpadmin'@'localhost' identified by 'admin888';
grant select,insert,update,delete,create,drop on ftpusers.* to 'ftpadmin'@'localhost.localdomain' identified by 'admin888';
flush privileges;

CREATE TABLE IF NOT EXISTS `users` (
  `user` varchar(20) NOT NULL,
  `password` int(64) NOT NULL,
  `uid` int(11) NOT NULL,
  `gid` int(11) NOT NULL,
  `dir` varchar(128) NOT NULL,
  `quotafiles` int(11) NOT NULL,
  `quotasize` int(11) NOT NULL,
  `ulbandwidth` int(11) NOT NULL,
  `dlbandwidth` int(11) NOT NULL,
  `ipaddress` varchar(15) NOT NULL,
  `comment` tinytext NOT NULL,
  `status` char(1) NOT NULL,
  `ulratio` smallint(5) NOT NULL,
  `dlratio` smallint(5) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

创建users表
create table if not exists `users`(
`user` varchar(16) not null default '',
`password` varchar(32) not null default '',
`uid` int(11) not null,
`gid` int (11) not null,
`dir` varchar(128) not null default '',
`quotafiles` int(10) not null default '500',
`quotasize` int(10) not null default '30',
`ulbandwidth` int(10) not null default '80',
`dlbandwidth` int(10) not null default '80',
`ipaddress`男篮世界杯赌球, varchar(15) not null default '*',
`comment` tinytext,
`status` enum('0','1') not null default '1',
`ulratio` smallint(5) not null default '1',
`dlratio` smallint(5) not null default '1',
primary key (`user`),
unique key `user` (`user`)
)engine=myisam default charset=latin1;

6、重启pure-ftpd

6、配置Pure-FTPd的mysql.conf
sudo mv /etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf_orig
sudo nano /etc/pure-ftpd/db/mysql.conf
MySQLServer 127.0.0.1
MySQLSocket /var/run/mysqld/mysqld.sock
MySQLUser ftpadmin
MySQLPassword xdnice*
MySQLDatabase ftpusers
MySQLCrypt md5
MySQLGetPW SELECT password FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetUID SELECT uid FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetGID SELECT gid FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetDir SELECT dir FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetQTAFS SELECT quotafiles FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetQTASZ SELECT quotasize FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetRatioUL SELECT ulratio FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGetRatioDL SELECT dlratio FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGETBandwidthUL SELECT ulbandwidth FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")
MySQLGETBandwidthDL SELECT dlbandwidth FROM users WHERE user="L" AND status="1" AND (ipaddress="*" OR ipaddress LIKE "R")

sudo /etc/init.d/pure-ftpd-mysql restart

sudo chmod g=o= /etc/pure-ftpd/db/mysql.conf

本文由美洲杯赌球发布于计算机教程,转载请注明出处:Linux下pure-ftpd服务553错误解决办法

TAG标签:
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。