问题描述:
看下 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. 微信内分享第三方H5链接无法使用内置浏览器打开的解决方案

    很多朋友在微信内想分享转发H5链接的时候都会很容易碰到H5链接在微信内无法打开或在微信内无法打开app下载页的情况.通常这种情况微信会给个提示 “已停止访问该网址” ,那么导致这个情况的因素有哪些呢, ...

  2. MR-join连接

    package com.bw.mr; import java.io.BufferedReader; import java.io.IOException; import java.io.InputSt ...

  3. 【刷题】Git工作流-相关知识点

    参考资料:[学习总结]Git学习-GIT工作流-千峰教育(来自B站) 1-Git工作流 GitFlow流五大分支: 主干分支 热修复分支 预发布分支 开发分支 功能分支 GitFlow 工作流定义了一 ...

  4. nodejs 实现跨域

    1.nodejs let http = require('http'); http.createServer((req,res) => { res.setHeader("Access- ...

  5. windows编程 进程的创建销毁和分析

    Windows程序设计:进程 进程是一个具有一定独立功能的程序关于某个数据集合的一次运行活动,在Windows编程环境下,主要由两大元素组成: • 一个是操作系统用来管理进程的内核对象.操作系统使用内 ...

  6. Oracle查看表实际占用空间和实际行数

    select t.table_name,t.num_rows from user_tables t ORDER BY NUM_ROWS DESC;//实际行数 analyze table emp co ...

  7. Java面试题之高级篇研读

    1.List和Set比较,各自的子类比较 对比一:ArrayList与LinkedList比较 1.ArrayList是实现了基于动态数组的数据结构,因为地址连续,一旦数据存储好了,查询操作效率会比较 ...

  8. Day 1 上午

    唉,上午就碰到一个开不了机的电脑,白白浪费了半个小时,真的难受QwQ POINT1 枚举 枚举也称作穷举,指的是从问题所有可能的解的集合中一一枚举各元素. 用题目中给定的检验条件判定哪些是无用的,哪些 ...

  9. xadmin 数据添加报错: IndexError: list index out of range

    报错现象 xadmin 集成到项目后进行添加数据的时候报错 具体如下 黄页 后端 具体报错定位 报错分析 点击这里 报错解决 源码 input_html = [ht for ht in super(A ...

  10. LA4080/UVa1416 Warfare And Logistics 最短路树

    题目大意: 求图中两两点对最短距离之和 允许你删除一条边,让你最大化删除这个边之后的图中两两点对最短距离之和. 暴力:每次枚举删除哪条边,以每个点为源点做一次最短路,复杂度\(O(NM^2logN)\ ...