作者:OP尋一 | 来源:互联网 | 2014-05-28 09:12
由于ProFTPD不存在于CentOS中yum的官方库中,所以用yum安装ProFTPD需要定义非官方的库。请先确认相应非官方库文件的存在。[root@sample~]#ls-l/etc/yum.repos.d/dag.repo←确认相应库文件的存在性-rw-r--r--1rootroot143Oct121:33/et
由于ProFTPD不存在于CentOS中yum的官方库中,所以用yum安装ProFTPD需要定义非官方的库。请先确认相应非官方库文件的存在。
[root@sample ~]# ls -l /etc/yum.repos.d/dag.repo ← 确认相应库文件的存在性
-rw-r--r-- 1 root root 143 Oct 1 21:33 /etc/yum.repos.d/dag.repo ← 确认其存在(否则不能通过yum安装ProFTPD)
如果以上,dag.repo文件不存在,则不能通过yum安装ProFTPD,需要定义非官方库。定义非
官方库
[root@sample ~]# vi /etc/yum.repos.d/dag.repo ← 建立dag.repo,定义非官方库
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
[root@sample ~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt ← 导入非官方库的GPG
http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt内容如下
The following public key can be used to verify RPM packages
downloaded from http://dag.wieers.com/apt/ using 'rpm -K'
if you have the GNU GPG package.
Questions about this key should be sent to:
Dag Wieers
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.2.1 (GNU/Linux)
mQGiBD9JMT0RBAC9Q2B0AloUMTxaK73sD0cOu1MMdD8yuDagbMlDtUYA1aGeJVO6
TV02JLGr67OBY+UkYuC1c3PUwmb3+jakZd5bW1L8E2L705wS0129xQOZPz6J+alF
5rTzVkiefg8ch1yEcMayK20NdyOmhDGXQXNQS8OJFLTIC6bJs+7MZL83/wCg3cG3
3q7MWHm3IpJb+6QKpB9YH58D/2WjPDK+7YIky/JbFBT4JPgTSBy611+bLqHA6PXq
39tzY6un8KDznAMNtm+NAsr6FEG8PHe406+t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线安装ProFTPD。
[root@sample ~]# yum -y install proftpd ← 安装ProFTPD
[root@sample ~]# vi /etc/proftpd.conf
这里给一个简单配置:
# This sample configuration file illustrates configuring two
# anonymous directories, and a guest (same thing as anonymous but
# requires a valid password to login)
ServerName "ProFTPD Anonymous Server"
ServerType standalone
DefaultServer on
DefaultRoot ~
Umask 002
# Port 21 is the standard FTP port.
Port 21
# If you don't want normal users logging in at all, uncomment this
# next section
#
# DenyAll
#
# Set the user and group that the server normally runs at.
User cui
Group ftpwei
MaxInstances 30
TimeoutStalled 300
AllowOverwrite on
AllowUser cui
IgnoreHidden on
AllowUser yangr
IgnoreHidden on
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
#DisplayFirstChdir .message
启动proftp之前要建立ftp用户信息:
groupadd ftpwei ← 建ftp用户组
useradd cui -g ftpwei -d /var/www/html -s /sbin/nologin ← 建用户,所属目录,禁止ssh登录
useradd yangr -g ftpwei -d /var/www/html/yangr -s /sbin/nologin ← 再建一个
chown -R cui:ftpwei /var/www/html ← 设置用户的目录权限
chown -R yangr:ftpwei /var/www/html/yangr ← 设置用户的目录权限
启动service proftpd start
设置随机启动:
[root@sample certs]# chkconfig xproftpd on ← 设置ProFTPD自启动
[root@sample certs]# chkconfig --list xproftpd ← 查看ProFTPD自启动
xproftpd on ← 确认为on的状态就OK
[root@sample certs]# /etc/rc.d/init.d/xinetd restart ← 重新启动超级服务器
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]