问题描述:
看下 1.1.1.1 的ftp为什么连不上 报错的信息:
'ftpServer' => '1.1.1.1', // FTP服务器地址
'ftpPort' => '',
'ftpUsername' => 'admin.was.chinasoft.com', // FTP账号
'ftpPassword' => 'ftp_pass',
报错信息:
FTP connection has failed!Attempted to connect to 1.1.1.1 for user admin.was.chinasoft.com 处理过程:
首先登录 1.1..1_server01_was_web01 这台网宿的服务器 .查看进程是否正常
[root@server01:/usr/local/proftpd-1.3.6rc2]# ps -ef|grep ftp
apache : ? :: proftpd: (accepting connections)
apache : ? :: proftpd: admin.was.chinasoft.com - 3.3.3.3: IDLE .连接21端口,看服务是否能够正常通讯
C:\Users\ws>telnet 2.2.2.2 .找到/usr/local/proftpd-1.3.6rc2/的程序运行目录 [root@server01:/usr/local/proftpd-1.3.6rc2]# cd /usr/local/proftpd-1.3.6rc2/
[root@server01:/usr/local/proftpd-1.3.6rc2]# ll
total
-rwxr-xr-x root root Apr adduser_domain.sh
-rwx------ root root Apr adduser.sh
drwxr-xr-x root root Apr bin
drwxr-xr-x root root Jul : etc
drwxr-xr-x root root Apr include
drwxr-xr-x root root Apr lib
drwxr-xr-x root root Apr libexec
-rwxr-xr-x root root Mar proftpd.sh
drwxr-xr-x root root Apr sbin
drwxr-xr-x root root Apr share
drwxr-xr-x root root Jul : var # 添加用户的脚本(作废)
[root@server01:/usr/local/proftpd-1.3.6rc2]# cat adduser.sh
#!/bin/bash
usage () {
echo ""
echo " Please Input Correct infomation!"
echo ""
echo " USAGE: `basename $0` username /dir ftp_server_ip"
echo " Exp: `basename $0` Lee /data/lee/home 1.1.1.1,2.2.2.2"
echo ""
echo " Result:"
echo " UserName: Lee"
echo " UserHome: /data/lee/home"
echo " PassWord: N1Jy3Fqol"
echo ""
} if [[ $ == "" ]];then
usage;
exit ;
fi datetime=`date +%Y%m%d" "%H:%M:%S`
userid=$
passwd=`mkpasswd -l -d -c -C -s `
home=$
dst_passwd='{md5}'`/bin/echo -n "$passwd" | openssl dgst -binary -md5 | openssl enc -base64`
shell='/sbin/nologin'
accesshost=$
/usr/local/mysql/bin/mysql -u ftp_user -p'pass' -h 192.168.1.189 -e "\
use ftp_db;insert into FTPUSERS VALUES('$userid','$dst_passwd',,,'$home','/sbin/nologin','$accesshost','$datetime');"
echo "UserName: $userid"
echo "PassWord: $passwd"
echo "userHome: $home"
echo "FTP IPs: $accesshost"
echo "" # 添加用户和域名对应关系的脚本
[root@server01:/usr/local/proftpd-1.3.6rc2]# cat adduser_domain.sh
#!/bin/bash usage () {
echo ""
echo " Please Input Correct infomation!"
echo ""
echo " USAGE: `basename $0` domainname ftp_server_ip"
echo " Exp: `basename $0` www.test.com Server1,Server2"
echo ""
echo " Result:"
echo " UserName: www.test.com"
echo " PassWord: N1Jy3Fqol"
echo ""
} if [[ $ == "" ]];then
usage;
exit ;
fi datetime=`date +%Y%m%d" "%H:%M:%S`
userid=$
passwd=`mkpasswd -l -d -c -C -s `
domain=$userid
if [[ $ =~ ^www ]];then
domain=${#www.}
fi
dst_passwd='{md5}'`/bin/echo -n "$passwd" | openssl dgst -binary -md5 | openssl enc -base64`
home="/data/www/vhosts/$domain"
shell='/sbin/nologin'
accesshost=$
/usr/local/mysql/bin/mysql -u ftp_user -p'pass' -h 192.168.1.189 -e "\
use ftp_db;insert into FTPUSERS VALUES('$userid','$dst_passwd',,,'$home','/sbin/nologin','$accesshost','$datetime');"
echo "UserName: $userid"
echo "PassWord: $passwd"
echo "FTP IPs: $accesshost"
echo "" ***192.168..189这个mysql不存在 ③继续查看配置文件 [root@server01:/usr/local/proftpd-1.3.6rc2/etc]# cat /usr/local/proftpd-1.3.6rc2/etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon. ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on # Port is the standard FTP port.
Port # Don't use IPv6 support by default.
UseIPv6 off # Umask is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask
TimeoutLogin
TimeoutIdle
TimeoutNoTransfer
TimeoutStalled
# Where do we put the pid files?
#ScoreboardPath /var/run/proftpd
# To prevent DoS attacks, set the maximum number of child processes
# to . If you need to allow more than concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances
MaxLoginAttempts
# Set the user and group under which the server will run.
User apache
Group users # To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~ # Normally, we want files to be overwriteable.
AllowOverwrite on
# 上传断点续传
AllowRetrieveRestart on
AllowStoreRestart on
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit> # A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
#<Anonymous ~ftp>
# User ftp
# Group ftp # We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp # Limit the maximum number of anonymous logins
# MaxClients # We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayChdir .message # Limit WRITE everywhere in the anonymous chroot
# <Limit WRITE>
# DenyAll
# </Limit>
#</Anonymous>
#设置MySQL认证:
#数据库联接的信息,DatabaseName是数据库名, HostName是主机名,
#Port是端口号,UserName是连接数据库的用户名,Password是密码。
SQLConnectInfo ftp_db@192.168.1.148 ftp_user pass #数据库认证的类型:
SQLAuthTypes OpenSSL #指定用来做用户认证的表的有关信息。("FTPUSERS"和"FTPGRPS"是数据表名字,等一会而在下面建立)
SQLUserInfo FTPUSERS userid passwd uid gid home shell
SQLGroupInfo FTPGRPS grpname gid members #设置如果shell为空时允许用户登录:
RequireValidShell off #数据库的鉴别
SQLAuthenticate users groups usersetfast groupsetfast #如果home目录不存在,则系统会为根据它的home项新建一个目录:
CreateHome off #判断这个用户是否允许登录本机
#SQLUserWhereClause "accesshost like'%10.10.26.195%'" #这里的%号ProFtp不识别, 妈的!所以用下面的方法.
SQLUserWhereClause "0 !=FIND_IN_SET('2.2.2.2',accesshost)" #SQL验证日志
#SQLLog
SQLLogFile /usr/local/proftpd/var/sql.log #SQL验证用户的UID和GID
SQLMinUserUID
SQLMinUserGID
SQLDefaultUID
SQLDefaultGID ##### #####
MaxClients
UseReverseDNS off
IdentLookups off
#QuotaLimitTable file:/usr/local/proftpd1./etc/ftpquota.limittab
#QuotaTallyTable file:/usr/local/proftpd1./etc/ftpquota.tallytab
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaEngine on
QuotaLog /usr/local/proftpd/var/quota.log
QuotaShowQuotas on
QuotaOptions ScanOnLogin
DefaultRoot ~
DisplayLogin welcome.msg
AllowStoreRestart on ############ Fixed Log Format #########
LogFormat awstats "%t %h %u %m %f %s %b"
ExtendedLog /usr/local/proftpd/var/transfer.log read,write awstats
TransferLog /usr/local/proftpd/var/transfer.log
ServerLog /usr/local/proftpd/var/server.log
#Single system with both ProFTPd and Clamd utilizing TCP sockets. Additionally, only files who's size is less than 250MB will be scanned. ④找到关键信息
SQLConnectInfo ftp_db@192.168.1.148 ftp_user pass 连接数据库,查看表FTPUSERS查看表,猜想这个表就是用户名密码和权限的控制表 [root@server01:/usr/local/proftpd-1.3.6rc2]# mysql -h192.168.1. -uftp_user -p'pass'
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.--log Source distribution Copyright (c) - Percona LLC and/or its affiliates
Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ftp_db |
+--------------------+
rows in set (0.00 sec) mysql> use ftp_db;
Database changed
mysql> show tables;
+------------------+
| Tables_in_ftp_db |
+------------------+
| FTPGRPS |
| FTPUSERS |
| quotalimits |
| quotatallies |
+------------------+
rows in set (0.00 sec) mysql> select * from FTPUSERS;
+---------------------------------------+-------------------------------+-----+-----+-----------------------------------------------------------------------------------------------------------------------------------+---------------+--------------------------+-------------------+
| userid | passwd | uid | gid | home | shell | accesshost | coment |
+---------------------------------------+-------------------------------+-----+-----+-----------------------------------------------------------------------------------------------------------------------------------+---------------+--------------------------+-------------------+
| pay_com | {md5}MCbog7BadfaroQ== | | | /data/www/vhosts/platform.chinasoft.com | /sbin/nologin | web3 | | 通过本地登录ftp报错:
root@server01:/usr/local/proftpd-1.3.6rc2]# tail -f /usr/local/proftpd/var/server.log -- ::, server01 proftpd[] 2.2.2.2 (3.3.3.3[3.3.3.3]): USER admin.was.chinasoft.com: no such user found from 3.3.3.3 [3.3.3.3] to 1.1.1.1: 结合客户端报错:
FTP connection has failed!Attempted to connect to 1.1.1.1 for user admin.was.chinasoft.com 数据库中有 1.1.1.1 这个授权
INSERT INTO ``(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('admin.was.chinasoft.com', '{md5}eddddd==', , , '/data/www/vhosts/admin.was.chinasoft.com', '/sbin/nologin', 'web3', '20150306 17:30:57');
INSERT INTO ``(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('admin.was.chinasoft.com', '{md5}bOBvuP1/afda==', , , '/data/www/vhosts/admin.was.chinasoft.com', '/sbin/nologin', '1.1.1.1', '20150818 23:29:30'); 报错提到了2.2.2.2刚好是这个服务器的两个IP,于是添加2.2.2.2授权
INSERT INTO ``(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('admin.was.chinasoft.com', '{md5}bOBvuP1/afdfdadfa==', , , '/data/www/vhosts/admin.was.chinasoft.com', '/sbin/nologin', '2.2.2.2', '20180706 10:58:00'); 重新登录发现可以正常获取ftp家目录,至此问题解决
cc-download.chinasoft.cc的处理

# 添加用户的时候报错

[root@sz_chinasoft:/usr/local/proftpd]# ./adduser.sh cc-download.chinasoft.cc /data/www/vhosts/cc-download.chinasoft.cc 1.1.1.1
./adduser.sh: line : mkpasswd: command not found
mysql: [Warning] Using a password on the command line interface can be insecure.
UserName: cc-download.chinasoft.cc
PassWord:
userHome: /data/www/vhosts/cc-download.chinasoft.cc
FTP IPs: 1.1.1.1 # 解决
# yum install -y expect [root@sz_chinasoft:/usr/local/proftpd]# ./adduser.sh cc-download.chinasoft.cc /data/www/vhosts/cc-download.chinasoft.cc 2.2.2.2
mysql: [Warning] Using a password on the command line interface can be insecure.
UserName: cc-download.chinasoft.cc
PassWord: 5sjVCiP3y
userHome: /data/www/vhosts/cc-download.chinasoft.cc
FTP IPs: 2.2.2.2 select * from FTPUSERS where userid like 'cc-download.chinasoft.cc' limit INSERT INTO `FTPUSERS`(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-download.chinasoft.cc', '{md5}YO/rrFcFuus/1wWWpl2DcQ==', , , '/data/www/vhosts/cc-download.chinasoft.cc', '/sbin/nologin', 'sz_chinasoft', '20190515 20:06:42'); SELECT userid, passwd, uid, gid, home, shell FROM FTPUSERS WHERE (userid='cc-download.chinasoft.cc') AND ((( !=FIND_IN_SET('sz_chinasoft',accesshost)))) LIMIT # 观察日志 [root@sz_chinasoft:/usr/local/proftpd/var]# tail -f sql.log
-- ::, mod_sql/4.3[]: >>> cmd_endpwent
-- ::, mod_sql/4.3[]: <<< cmd_endpwent
。。。 -- ::, mod_sql/4.3[]: query "SELECT userid, passwd, uid, gid, home, shell FROM FTPUSERS WHERE (userid='cc-download.chinasoft.cc') AND (((0 !=FIND_IN_SET('sz_chinasoft',accesshost)))) LIMIT 1"
。。。。
-- ::, mod_sql/4.3[]: connection 'default' count is now
-- ::, mod_sql/4.3[]: exiting mysql cmd_open
-- ::, mod_sql/4.3[]: query "SELECT grpname FROM FTPGRPS WHERE (gid = 100) LIMIT 1"
-- ::, mod_sql/4.3[]: entering mysql cmd_close
-- ::, mod_sql/4.3[]: connection 'default' count is now
-- ::, mod_sql/4.3[]: exiting mysql cmd_close
-- ::, mod_sql/4.3[]: exiting mysql cmd_select # 拿这句去数据库里面查询是查不到信息的 SELECT userid, passwd, uid, gid, home, shell FROM FTPUSERS WHERE (userid='cc-download.chinasoft.cc') AND ((( !=FIND_IN_SET('sz_chinasoft',accesshost)))) LIMIT AND ((( !=FIND_IN_SET('sz_chinasoft',accesshost)))) LIMIT 1这句来自配置文件 [root@sz_chinasoft:/usr/local/proftpd/var]# more ../etc/proftpd.conf #判断这个用户是否允许登录本机
#SQLUserWhereClause "accesshost like'%10.10.26.195%'" #这里的%号ProFtp不识别, 所以用下面的方法.
SQLUserWhereClause "0 !=FIND_IN_SET('sz_chinasoft',accesshost)" # 插入本机到数据库问题解决
INSERT INTO `FTPUSERS`(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-download.chinasoft.cc', '{md5}YO/rrFcFuus/1wWWpl2DcQ==', , , '/data/www/vhosts/cc-download.chinasoft.cc', '/sbin/nologin', 'sz_chinasoft', '20190515 20:06:42'); SELECT userid, passwd, uid, gid, home, shell FROM FTPUSERS WHERE (userid='cc-download.chinasoft.cc') AND ((( !=FIND_IN_SET('sz_chinasoft',accesshost)))) LIMIT

1.添加用户步骤

a.执行下面的脚本,注意修改脚本中连接数据库的ip和用户名密码
[root@web:/usr/local/proftpd]# ./adduser.sh cc-dlinst.chinasoft.cc /data/www/vhosts/dlinst.chinasoft.com 120.1.1.1
mysql: [Warning] Using a password on the command line interface can be insecure.
UserName: cc-dlinst.chinasoft.cc
PassWord: pass
userHome: /data/www/vhosts/dlinst.chinasoft.com
FTP  IPs: 120.1.1.1

2.还需要插入如下4条字段,注意是 登录ftp服务器的内网、外网ip、还有ftp服务器的主机名 和 客户端的 外网ip
INSERT INTO ftpusers (`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-dlinst.chinasoft.cc', '{md5}/A==', 500, 100, '/data/www/vhosts/dlinst.chinasoft.com', '/sbin/nologin', '120.1.1.1', '20190711 01:37:01');
INSERT INTO ftpusers (`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-dlinst.chinasoft.cc', '{md5}/A==', 500, 100, '/data/www/vhosts/dlinst.chinasoft.com', '/sbin/nologin', 'sz_cc_cbs_download01', '20190515 20:06:42');
INSERT INTO ftpusers (`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-dlinst.chinasoft.cc', '{md5}/A==', 500, 100, '/data/www/vhosts/dlinst.chinasoft.com', '/sbin/nologin', '192.168.1.108', '20190711 01:37:01');
INSERT INTO ftpusers (`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('cc-dlinst.chinasoft.cc', '{md5}/A==', 500, 100, '/data/www/vhosts/cc-dlinst.chinasoft.com', '/sbin/nologin', '150.1.1.1', '20190708 14:37:00');

.ftp认证数据库信息

# 连接数据库的账号密码信息
grant select,insert,update,delete on ftp_db.* to ftp_user@"%" identified by "pass"; # 创建ftp认证表 CREATE TABLE `ftpgrps` (
`grpname` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`gid` smallint() NOT NULL,
`members` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `ftpusers` (
`userid` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`passwd` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`uid` int() NOT NULL,
`gid` int() NOT NULL,
`home` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`shell` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`accesshost` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`coment` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `quotalimits` (
`name` varchar() CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`quota_type` enum('user','group','class','all') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'user',
`per_session` enum('false','true') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'false',
`limit_type` enum('soft','hard') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'soft',
`bytes_in_avail` float NOT NULL DEFAULT ,
`bytes_out_avail` float NOT NULL DEFAULT ,
`bytes_xfer_avail` float NOT NULL DEFAULT ,
`files_in_avail` int() UNSIGNED NOT NULL DEFAULT ,
`files_out_avail` int() UNSIGNED NOT NULL DEFAULT ,
`files_xfer_avail` int() UNSIGNED NOT NULL DEFAULT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; CREATE TABLE `quotatallies` (
`name` varchar() CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`quota_type` enum('user','group','class','all') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'user',
`bytes_in_used` float NOT NULL DEFAULT ,
`bytes_out_used` float NOT NULL DEFAULT ,
`bytes_xfer_used` float NOT NULL DEFAULT ,
`files_in_used` int() UNSIGNED NOT NULL DEFAULT ,
`files_out_used` int() UNSIGNED NOT NULL DEFAULT ,
`files_xfer_used` int() UNSIGNED NOT NULL DEFAULT
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; # 添加ftp用户的脚本 /usr/local/proftpd/adduser.sh
#!/bin/bash usage () {
echo ""
echo " Please Input Correct infomation!"
echo ""
echo " USAGE: `basename $0` username /dir ftp_server_ip"
echo " Exp: `basename $0` Lee /data/lee/home 1.1.1.1,2.2.2.2"
echo ""
echo " Result:"
echo " UserName: Lee"
echo " UserHome: /data/lee/home"
echo " PassWord: N1Jy3Fqol"
echo ""
} if [[ $ == "" ]];then
usage;
exit ;
fi datetime=`date +%Y%m%d" "%H:%M:%S`
userid=$
passwd=`mkpasswd -l -d -c -C -s `
home=$
dst_passwd='{md5}'`/bin/echo -n "$passwd" | openssl dgst -binary -md5 | openssl enc -base64`
shell='/sbin/nologin'
accesshost=$
# 连接ftp_db的账号密码
/usr/local/mysql/bin/mysql -u cn_chinasoft_ftp_user -p'pass' -h ftp数据库的ip地址 -e "\
use ftp_db;insert into FTPUSERS VALUES('$userid','$dst_passwd',,,'$home','/sbin/nologin','$accesshost','$datetime');"
echo "UserName: $userid"
echo "PassWord: $passwd"
echo "userHome: $home"
echo "FTP IPs: $accesshost"
echo "" .ftp配置 # egrep -v '^#|^$' /usr/local/proftpd/etc/proftpd.conf
ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on
Port
UseIPv6 off
Umask
TimeoutLogin
TimeoutIdle
TimeoutNoTransfer
TimeoutStalled
MaxInstances
MaxLoginAttempts
User apache
Group users
AllowOverwrite on
AllowRetrieveRestart on
AllowStoreRestart on
<Limit SITE_CHMOD>
DenyAll
</Limit>
# 连接ftp认证数据库的信息
SQLConnectInfo ftp_db@xx ftp_user pass SQLAuthTypes OpenSSL
SQLUserInfo FTPUSERS userid passwd uid gid home shell
SQLGroupInfo FTPGRPS grpname gid members
RequireValidShell off
SQLAuthenticate users groups usersetfast groupsetfast
CreateHome off
# ftp服务器外网ip地址(即安装ftp服务端的ip地址)
SQLUserWhereClause "0 !=FIND_IN_SET('ftp_server_ip',accesshost)"
SQLLogFile /usr/local/proftpd/var/sql.log
SQLMinUserUID
SQLMinUserGID
SQLDefaultUID
SQLDefaultGID
MaxClients
UseReverseDNS off
IdentLookups off
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaEngine on
QuotaLog /usr/local/proftpd/var/quota.log
QuotaShowQuotas on
QuotaOptions ScanOnLogin
DefaultRoot ~
DisplayLogin welcome.msg
AllowStoreRestart on
LogFormat awstats "%t %h %u %m %f %s %b"
ExtendedLog /usr/local/proftpd/var/transfer.log read,write awstats
TransferLog /usr/local/proftpd/var/transfer.log
ServerLog /usr/local/proftpd/var/server.log .添加用户
# 命令格式:./adduser.sh 账号 根目录 ftp客户端ip地址
[/usr/local/proftpd]# ./adduser.sh download.chinasoft.cn /data/www/vhosts/download.chinasoft.cn 1.1.1.1
mysql: [Warning] Using a password on the command line interface can be insecure.
UserName: download.chinasoft.cn
PassWord: pass
userHome: /data/www/vhosts/download.chinasoft.cn
FTP IPs: 1.1.1.1 INSERT INTO `ftp_db`.`ftpusers`(`userid`, `passwd`, `uid`, `gid`, `home`, `shell`, `accesshost`, `coment`) VALUES ('download.chinasoft.cn', '{md5}da/6deocTTdo==', , , '/data/www/vhosts/download.chinasoft.cn', '/sbin/nologin', '1.1.1.1', '20200421 13:53:15');

ftp和mysql数据库结合使用的更多相关文章

  1. ftp获取mysql数据库方法

    我说的这种情况是针对mysql数据库的,首先下载一个mysql通过ftp放到站点里面,然后通过配置文件找到数据库的名字和密码,然后通过浏览器访问数据库,直接在域名后面加上下载的mysql文件的名字就可 ...

  2. Linux下自动备份MySQL数据库并上传到远程FTP服务器

    Linux下自动备份MySQL数据库并上传到远程FTP服务器且删除指定日期前的备份Shell脚本 说明:  1.备份MySQL数据库存放目录/var/lib/mysql下面的xshelldata数据库 ...

  3. Linux VPS自动定时备份网站文件和MYSQL数据库到FTP空间(LNMP)

    如果我们网站更新不是很频繁,我们可以定期手动进行备份网站文件和MYSQL数据库导出.如果我们网站数据更新频繁,且数据尤为重要,建议要采用定期自动 备份,至少需要多备份数据,无论我们选择何种优秀的VPS ...

  4. python + docker, 实现天气数据 从FTP获取以及持久化(二)-- python操作MySQL数据库

    前言 在这一节中,我们主要介绍如何使用python操作MySQL数据库. 准备 MySQL数据库使用的是上一节中的docker容器 “test-mysql”. Python 操作 MySQL 我们使用 ...

  5. CentOS Linux自动备份MySQL数据库到远程FTP服务器并删除指定日期前的备份Shell脚本

    说明: 我这里要把MySQL数据库存放目录/var/lib/mysql下面的pw85数据库备份到/home/mysql_data里面,并且保存为mysqldata_bak_2011_11_03.tar ...

  6. 二进制包安装MySQL数据库

    1.1二进制包安装MySQL数据库 1.1.1 安装前准备(规范) [root@Mysql_server ~]# mkdir -p /home/zhurui/tools ##创建指定工具包存放路径 [ ...

  7. 腾讯云服务器centos 6.5(jdk+tomcat+vsftp)、腾讯mysql数据库 及 tomcat自启动 配置教程

    1.腾讯云数据库配置 1.考虑到安全性问题,,平常不使用root用户登录,新增一个用户名neil,用来管理项目的数据库 a.首先登录root创建db_AA数据库 b.在root用户下,创建neil用户 ...

  8. 使用xtrabackup备份mysql数据库

    数据在一个企业里非常重要,因此经常需要备份数据库,确保出线故障时,可以立刻恢复数据到最新状态,目前常见的备份工具有mysqldump和xtrabackup,数据量较少时可以使用mysqldump,但随 ...

  9. Centos下mysql数据库备份与恢复的方法

    一.mysqldump工具备份 mysqldump由于是mysql自带的备份工具,所以也是最常用的mysql数据库的备份工具.支持基于InnoDB的热备份.但由于是逻辑备份,所以速度不是很快,适合备份 ...

随机推荐

  1. Centos6.5 pppoe-server

    [root@localhost network-scripts]# rpm -q rp-pppoepackage rp-pppoe is not installed ----------------- ...

  2. mybatis将传入的Integer类型的0被识别成空字符串的问题

    更改mapper文件的sql如下: <if test="interger != null"> interger= #{interger} </if> 原因: ...

  3. python爬取某站上海租房图片

    前言 对于一个net开发这爬虫真真的以前没有写过.这段时间开始学习python爬虫,今天周末无聊写了一段代码爬取上海租房图片,其实很简短就是利用爬虫的第三方库Requests与BeautifulSou ...

  4. 基于zookeeper实现分布式锁

    Zookeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Hadoop和Hbase的重要组件. 特性: 1.节点数据结构,znode是一个跟Unix文件系统路径相似的节点,可以往这个节点存 ...

  5. codeforces131D

    Subway CodeForces - 131D A subway scheme, classic for all Berland cities is represented by a set of  ...

  6. 树莓派3B+(三)

    上一篇中,我们配置好了基本的raspbain系统,接下来我们可以用xrdp或者vnc在Windows上远程连接树莓派. 一.安装xrdp xrdp和vnc是两种常见的远程桌面协议,可以进行可视化界面远 ...

  7. The King’s Problem HDU - 3861(连通图 缩点 匹配)

    在一个王国里面, 国王有一个新的问题. 皇城中有N个城市M条单行路,为了让他的王国更加高效,国王想要将他的王国划分成几个州,每个城市必须属于一个州.对于两个城市(u,v),必须满足以下3个条件:   ...

  8. 【转】C语言堆栈入门——堆和栈的区别

    @2019-04-25 [小记] C语言堆栈入门——堆和栈的区别

  9. Matlab 中subsystem mask封装子系统

    Icon&port %%外型图表封装 %%.曲线型标注: plot(cos(:*pi),sin(:*pi)) %%.文字型标注: disp('PID\n控制器') %%.曲线加文字型标注: p ...

  10. 1.0--->刚开始看这里

    PyQt5使用笔记 创建一个小窗口 import sys from PyQt5.QtWidgets import * #程序实例化 app = QApplication(sys.argv) # #创建 ...