Proftpd 配置安装

一、安装proftpd软件 http://www.proftpd.org下载下来的是一个压缩包

tar zxvf proftpd-1.3.1.tar.gz 进行解压
cd proftpd-1.3.1 进入文件夹

./configure --prefix=/etc/proftpd 把proftpd-1.3.1安装到/etc/proftpd文件夹下
make
make install

make clean

二、新建用户
groupadd proftp 创建一个proftp组

useradd -g proftp -d /var/ftp/yatan -s /sbin/nologin yatan 这句话我的理解是(新建 yatan用户,并把它加入proftp组,把yatan的目录建在/var/ftp目录下,并指定它的shell为nologin,这个nologin 并不能让yatan用户进入linux系统

passwd yatan 设置yatan的密码

好了,用户设置好了 : )

三、在开始配置proftpd.conf文件之前进行以下操作:
1、因为我用的是红帽子as4.0的,所以先要把自带的vsftpd给停掉
service vsftpd stop 或者直接 rpm –e vsftpd

2、设置一个proftpd的启动服务
编辑一个启动脚本,
cd proftpd-1.3.1 进入proftpd-1.3.1的解压文件夹中
cp contrib/dist/rpm/proftpd.init.d /etc/rc.d/init.d/proftpd 拷贝proftpd.init.d到/etc/rc.d/init.d文件夹中,并改名为proftpd
vi /etc/rc.d/init.d/proftpd 编辑这个文件,找到文件中有一行是PATH行,将它改成你所安装proftpd所在的目录。
PATH="$PATH:/etc/proftpd/sbin:/etc/proftpd/bin" 我是安装在/etc/proftpd文件下,保存退出
3、把/etc/rc.d/init.d/proftpd设成可执行文件
chmod +x /etc/rc.d/init.d/proftpd

# 然后运行命令:
[root@localhost /]# chkconfig --level 35 proftpd on

# 则下次系统启动以后,proftpd将自动启动。

chkonfig –add proftpd
这样就可以用service proftpd start和service proftpd stop 和service proftpd restart来分别执行开启服务,停止服务与重启服务

差点忘了要改配置文件了,嘻
vi /etc/proftpd/etc/proftpd.conf
在全局配置里把group的值为nogroup改成nobody
好了,配置前的工作做好了

四、现在正式来配置proftpd.conf里的权限设置,
vi /etc/proftpd/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 21 is the standard FTP port.
Port 21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022

# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 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 30

# Set the user and group under which the server will run.
User   nobody
Group nobody (这边就是我在上一步所讲的设置成nobody)

# 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

# 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 10

# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message

# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>

<Directory />
AllowOverwrite on
AllowStoreRestart on
#AllowForeignAddress on
<Limit All>
AllowAll
</Limit>
</Directory>

<Directory /var/ftp/yatan>
<Limit DELE RNFR RNTO RMD XRMD>
DenyUser yatan
</Limit>
</Directory> (这几句是对yatan用户的权限限制,只允许它对/var/ftp/yatan有写的权限,不允许它有DELE RNFR RNTO RMD XRMD的权限)

存盘退出
service proftpd restart

五、修改一下/var/ftp目录的权限
chmod –R 775 /var/ftp 
这样tc对/var/ftp/skate的文件具有写,删,改,执行的所有权限。

 

 

http://www.yatan.com/group/topic.php?tid=21356

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值