您的位置:首页 > 编程语言 > PHP开发

vsftpd启动方式改变为xinetd

2016-05-23 16:57 609 查看
一.软件安装:
[root@localhost ~]#yum -y install vsftpd xinetd ftp
[root@localhost ~]#cp /usr/share/doc/vsftpd-2.2.2/vsftpd.xinetd  /etc/xinetd.d/vsftpd
三.修改配置文件
[root@localhost ~]#cat /etc/vsftpd/vsftpd.conf |grep listen= (默认yes改为no)
listen=NO
[root@localhost ~]# cat /etc/vsftpd/vsftpd.conf |grep tcp_wrapper (默认yes改为no)
tcp_wrappers=NO
[root@localhost ~]# cat /etc/xinetd.d/vsftpd |grep disable   (默认yes改为no)
disable= no
四.启动服务
[root@localhost ~]# /etc/init.d/xinetd  restart
五.测试
[root@localhost ~]# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 2.2.2)
Name (127.0.0.1:root): xxxx
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
扩展操作:限制客户访问vsftpd的访问时间段(限制客户8:30到11:30可以登录)
方法1:修改配置文件
[root@localhost ~]# vim /etc/xinetd.d/vsftpd
service ftp{
socket_type     = stream
wait            = no
user            = root
server          = /usr/sbin/vsftpd
server_args     = /etc/vsftpd/vsftpd.conf
nice            = 10
disable         = no
access_times    =8:30-11:30       #(限制客户8:30到11:30可以登录)
flags           = IPv4
}
[root@localhost ~]# /etc/init.d/xinetd  restart    #即可在指定时间段登陆
[root@localhost ~]# iptables -A INPUT -p  tcp -s 192.168.66.0/255.255.255.0 --dport 21 -m time --timestart 8:30 --timestop 11:30 -j ACCEPT
[root@localhost ~]# iptables -A OUTPUT -p tcp -d 192.168.66.0/255.255.255.0 --sport 21 -m time --timestart 8:30 --timestop 11:30 -j ACCEPT
原文地址:http://blog.chinaunix.net/uid-26719405-id-3919506.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  启动 配置 ftp