pam_mysql 认证 ftp 虚拟用户账号,且拥有不同的权限
1、安装 mariadb-server
查看是否安装 mariadb-server
[root@neo ~]# yum info mariadb-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Installed Packages
Name : mariadb-server
Arch : x86_64
Epoch : 1
Version : 5.5.60
Release : 1.el7_5
Size : 58 M
Repo : installed
From repo : base
Summary : The MariaDB server and related files
URL : http://mariadb.org
License : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a multi-user, multi-threaded SQL database server. It is a
: client/server implementation consisting of a server daemon (mysqld)
: and many different client programs and libraries. This package contains
: the MariaDB server and some accompanying files and directories.
: MariaDB is a community developed branch of MySQL.
查看 mariadb-server 的程序名称
[root@neo ~]# rpm -ql mariadb-server | grep "/usr/lib/systemd/"
/usr/lib/systemd/system/mariadb.service
2、安装 pam 模块
在 CentOS 上安装 pam 模块时,需要编译进行安装。
2.1 安装 mariadb 和 pam 的开发环境
[root@neo ~]# yum install mariadb-devel pam-devel -y
2.2 准备开发环境,安装包组
[root@neo ~]# yum groupinstall "Development Tools" "Server Platform Development" -y
2.3 下载 pam_mysql ,进行解压
[root@neo home]# ls
pam_mysql-0.7RC1.tar.gz
[root@neo home]# ls
pam_mysql-0.7RC1 pam_mysql-0.7RC1.tar.gz
[root@neo home]# cd pam_mysql-0.7RC1
[root@neo pam_mysql-0.7RC1]# ls
acinclude.m4 config.guess configure CREDITS ltmain.sh missing pam_mysql.c pkg.m4
aclocal.m4 config.h.in configure.in INSTALL Makefile.am mkinstalldirs pam_mysql.spec README
ChangeLog config.sub COPYING install-sh Makefile.in NEWS pam_mysql.spec.in stamp-h.in
2.4 预编译检查
[root@neo pam_mysql-0.7RC1]# ./configure --with-pam=/usr --with-mysql=/usr --with-pam-mods-dir=/usr/lib64/security
2.5 进行编译
[root@neo pam_mysql-0.7RC1]# make && make install
2.6 pam 模块检查
编译完成后,会生成以下模块,有了这个模块 pam_mysql.so
就可以使用 mysql 去做认证了 。
[root@neo ~]# ls /usr/lib64/security/ | grep pam_mysql
pam_mysql.la
pam_mysql.so
3、vsftpd 安装
3.1 查看 vsftpd 是否安装
[root@neo ~]# yum info vsftpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Installed Packages
Name : vsftpd
Arch : x86_64
Version : 3.0.2
Release : 25.el7
Size : 353 k
Repo : installed
From repo : base
Summary : Very Secure Ftp Daemon
URL : https://security.appspot.com/vsftpd.html
License : GPLv2 with exceptions