今天服务器当机,重启后发现ftp无法使用.
[root@localhost ~]# ps -ef|grep ftp
test1 3112 3111 0 16:32 ? 00:00:00 /usr/libexec/openssh/sftp-server
user1 3358 3357 0 16:39 ? 00:00:00 /usr/libexec/openssh/sftp-server
果然ftp服务没有启动.
[root@localhost ~]# netstat -tuln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:6010 :::* LISTEN
tcp 0 0 ::1:6011 :::* LISTEN
21端口也没有使用.
因为安装时没有记笔记,也几乎忘记了怎样启动,依稀记得当时是以xinetd的方式启动的,为此也查了很多资料.
试着执行下面的命令:
[root@localhost ~]# /usr/local/sbin/vsftpd start
出现下面的错误:
500 OOPS: vsftpd: cannot open config file:start
指定配置文件:
[root@localhost ~]# /usr/local/sbin/vsftpd /etc/vsftpd.conf
接着出现下面的提示:
500 OOPS: tcp_wrappers is set to YES but no tcp wrapper support compiled in
这时以为是防火墙没有启动,于是手动启了一下静态防火墙:
[root@localhost ~]# service iptables start
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]
重新执行上面的命令后依然出现上面的错误.于是查了一下tcp_wrappers到底有没有用,有篇文章介绍http://freebsd.lab.mlc.edu.tw/tcp_wrappers/
仔细想想可能还需要重新编译vsftp,只是安全方面的设置,暂时先注释掉试试...
没想到又出现了下面的问题:
500 OOPS: vsftpd: not configured for standalone, must be started from inetd
后面加上&号后,还是出现上面的错误.突然想起以前好像有人说过最好不要用xinetd启动,于是就查一下如何以standalone方式启.
步骤如下:
1).vi /etc/xinetd.d/vsftpd
将disable=no 改为 disable=yes
2).vi /etc/vsftpd.conf
将listen=no 改为 listen=YES
3).service xinetd stop, 停掉xinetd服务.
4)./usr/local/sbin/vsftpd /etc/vsftpd.conf &
启动成功!
再试一下一直搞不明白的被动模式,也可以用了!我想可能和standalone启动方式有关,也可能和tcp_wrappers有关,有待进一步研究.
One Response
admin
07|10|2008 1pam是干什么用的?
Leave a reply