Chinaunix
标题:
默认 SuSE系统开启ftp服务
[打印本页]
作者:
wbzh
时间:
2009-09-17 20:45
标题:
默认 SuSE系统开启ftp服务
最近在使用SuSE系统,可是在开启ftp服务时,发现这个本来很简单的事情不是那么简单了。
SuSE系统采用的是Enterprise Server8,上面运行的服务有Oracle9i数据库。
首先修改
1./etc/vsftpd.conf将里面的write_enable=yes,anonymous_enable=yes,local_login=yes.
2./etc/inetd.conf将里面关于ftp的两行的注释去掉。
3.将/etc/ftpusers中不能出现将来要登录的帐户名。
进入/etc/init.d/执行:./inetd restart 。按照以前的经验这样ftp服务就应该打开了,可是在用
ftp 127.0.0.1的时候,给出提示:421 service not aviaible,connection closed
by remote compter.原以为21号端口没有打开,执行netstat -ntpl
查看监听端口21号端口在监听,然后又将ftp服务反复开启,结果还是不可用。
在看inetd.conf的时候看到后台运行的进程名字叫:vsftpd.那么它是不是可以手工启动来运行呢?想到就做:在终端中敲入vsftpd,这次又给出了提示说这个服务只能inetd来启动,我晕……
因为我用的这个版本是从Novell公司买来的,所以就咨询了他们的工程师,问题得到了解决,方法是:在/etc/vsftpd.conf文件中加入listen=yes这么一行。注意"="前后不能有空格。
修改了vsftpd.conf后,运行 vsftpd &。再用ftp 127.0.0.1,Ok!
本文来自ChinaUnix博客,如果查看原文请点:
http://blog.chinaunix.net/u1/59015/showart_2054815.html
作者:
milaoshuzaiyi
时间:
2011-03-21 23:23
按照这个试了试,但还是不行,估计我懂得太少了,继续努力!
作者:
chinaboywg
时间:
2011-03-23 09:34
#!/bin/bash
#by chinaboyxiaobao
# edit_config
function vsftpd_conifg()
{
sed 's/\#write_enable=YES/write_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp
mv /etc/vsftpd.conf.tmp /etc/vsftpd.conf
sed 's/\#local_enable=YES/local_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp
mv /etc/vsftpd.conf.tmp /etc/vsftpd.conf
sed 's/\#ascii_upload_enable=YES/ascii_upload_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp
mv /etc/vsftpd.conf.tmp /etc/vsftpd.conf
sed 's/#ascii_download_enable=YES/ascii_download_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp
mv /etc/vsftpd.conf.tmp /etc/vsftpd.conf
}
function allow_root()
{
sed 's/root/\#root/g' /etc/ftpusers >/etc/ftpusers.tmp
mv /etc/ftpusers.tmp /etc/ftpusers
}
i=`cat /etc/SuSE-release | grep VERSION |awk -F= '{print $2}'`
if [ "$i" -eq "9" ]
then
cat /etc/xinetd.d/vsftpd |grep disable | sed 's/yes/no/g' /etc/xinetd.d/vsftpd >/etc/xinetd.d/vsftpd.tmp
mv /etc/xinetd.d/vsftpd.tmp /etc/xinetd.d/vsftpd
vsftpd_conifg
allow_root
rcxinetd restart >/dev/null 2>&1
if [ $? = 0 ]
then
echo "SUSE Linux Enterprise Server $i open ftp service successful!"
else
echo "SUSE Linux Enterprise Server $i open ftp service failed!"
fi
fi
if [ "$i" -eq "10" ]
then
vsftpd_conifg
allow_root
rcvsftpd restart >/dev/null 2>&1
if [ $? = 0 ]
then
echo "SUSE Linux Enterprise Server $i open ftp service successful!"
else
echo "SUSE Linux Enterprise Server $i open ftp service failed!"
fi
fi
复制代码
用我写的脚本开启吧
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2