免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1285 | 回复: 4
打印 上一主题 下一主题

vsftpd架设ftp服务器 求救 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-13 20:19 |只看该作者 |倒序浏览
小弟 我是新手  用vm在xp下装了redhat as 3

想用vsftpd架设ftp服务器   下了最新版本 vsftpd-2.0.3.tar.gz

参照高手文章安装时 执行  make   发生错误

[root@EDI vsftpd-2.0.3]# make
gcc -c main.c -O2 -Wall -W -Wshadow  -idirafter dummyinc
make: gcc: Command not found
make: *** [main.o] Error 127

请各位高手指点  谢谢!

论坛徽章:
0
2 [报告]
发表于 2005-04-13 20:26 |只看该作者

vsftpd架设ftp服务器 求救

我是按这篇文章安装的


一、安装
    1.下载最新的稳定版vsftpd-1.2.1.tar.gz
       2.卸载原有的rpm的vsftpd
        rpm -e vsftpd
       3.tar xvzf vsftpd-1.2.1.tar.gz
       4.cd vsftpd-1.2.1
       5.make
       6.useradd nobody
       7.mkdir /usr/share/empty
       8.mkdir /var/ftp
       9.useradd -d /var/ftp ftp
       10.chown root.root /var/ftp
       11.chmod og-w /var/ftp
       说明:如果你象我一样原来有rpm的vsftp,只是卸载了,可以省略6-11步,如果原来没有安装vsftp,请按部就班。
      12.make install
       13.vi /etc/xinetd.d/vsftpd
        把disable=yes改成no,保存退出。然后service xinetd restart,OK!新装的vsftp已经可以工作了!
        说明:默认安装的vsftpd是以xinetd的方式启动的。你需要上述操作,一会儿,我们再来讲把它改成独立启动的服务。
      14.ftp 127.0.0.1
         输入用户名ftp,密码直接回车,OK!已经可以连接了!输入quit退出。然后重新ftp 127.0.0.1,输入本地用户和密码,却提示login faild!why?原来少一个本地用户认证的pam文件。
      15.cp RedHat/vsftpd.pam /etc/pam.d/ftp(注意,没有这一步将不能使用本地用户登录!)
      16.cp vsftpd.conf /etc/vsftpd.conf(现在,默认还是只能匿名用户登录)
      17.vi /etc/vsftpd.conf
         把anonmous_enable=YES改成NO(禁掉匿名链接,不安全)
         把local_enable=YES前的注释去掉(打开本地用户连接的权限)
         把write_enable=YES前的注释去掉(打开本地用户的写权限)
         把local_umask=022前的注释去掉
        service xinetd restart
      18.再次测试
         ftp 127.0.0.1
         使用ftp用户空密码登录,将出现login faild
         使用本地用户登录,OK!已经成功了!上传文件,也OK![/

论坛徽章:
0
3 [报告]
发表于 2005-04-13 20:31 |只看该作者

vsftpd架设ftp服务器 求救

gcc: Command not found

若在X下,把开发工具包全装了

论坛徽章:
0
4 [报告]
发表于 2005-04-13 20:32 |只看该作者

vsftpd架设ftp服务器 求救

这是vsftpd-2.0.3 的INSTALL


INSTALL
=======

This file details how to build and install / run vsftpd from the vsftpd
distribution .tar.gz file.

Step 1) Build vsftpd.

Switch to the directory created when you unpacked the vsftpd .tar.gz file.
e.g.:

cd vsftpd-1.1.2

edit "builddefs.h" to handle compile-time settings (tcp_wrappers build,
etc).

Just type "make" (and mail me to fix it if it doesn't build .
This should produce you a vsftpd binary. You can test for this, e.g.:

[chris@localhost vsftpd]$ ls -l vsftpd
-rwxrwxr-x    1 chris    chris       61748 Sep 27 00:26 vsftpd

Step 2) Satisfy vsftpd pre-requisites
2a) vsftpd needs the user "nobody" in the default configuration. Add this
user in case it does not already exist. e.g.:

[root@localhost root]# useradd nobody
useradd: user nobody exists

2b) vsftpd needs the (empty) directory /usr/share/empty in the default
configuration. Add this directory in case it does not already exist. e.g.:

[root@localhost root]# mkdir /usr/share/empty/
mkdir: cannot create directory `/usr/share/empty': File exists

2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
valid home directory (which is NOT owned or writable by the user "ftp".
The following commands could be used to set up the user "ftp" if you do not
have one:

[root@localhost root]# mkdir /var/ftp/
[root@localhost root]# useradd -d /var/ftp ftp

(the next two are useful to run even if the user "ftp" already exists).
[root@localhost root]# chown root.root /var/ftp
[root@localhost root]# chmod og-w /var/ftp

Step 3) Install vsftpd config file, executable, man page, etc.

Running "make install" will try to copy the binary, man pages, etc. to
somewhere sensible.
Or you might want to copy these things by hand, e.g.:
cp vsftpd /usr/local/sbin/vsftpd
cp vsftpd.conf.5 /usr/local/man/man5
cp vsftpd.8 /usr/local/man/man8

"make install" doesn't copy the sample config file. It is recommended you
do this:
cp vsftpd.conf /etc

Step 4) Smoke test (without an inetd).

vsftpd can run standalone or via an inetd (such as inetd or xinetd). You will
typically get more control running vsftpd from an inetd. But first we will run
it without, so we can check things are going well so far.
Edit /etc/vsftpd.conf, and add this line at the bottom:

listen=YES

This tells vsftpd it will NOT be running from inetd.
Right, now let's try and run it!
Log in as root.
Make sure you are not running other FTP servers (or vsftpd will not be able
to use the FTP port, 21).
Run the binary from wherever you put it, e.g.:

[root@localhost root]# /usr/local/sbin/vsftpd &
[1] 2104

If all is well, you can now connect! e.g.:

[chris@localhost chris]$ ftp localhost
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.1.1)
Name (localhost:chris): ftp
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>; ls
227 Entering Passive Mode (127,0,0,1,229,133)
150 Here comes the directory listing.
d--x--x--x    2 0        0            4096 Jan 14  2002 bin
d--x--x--x    2 0        0            4096 Apr 21 20:52 etc
drwxr-xr-x    2 0        0            4096 Apr 21 20:52 lib
drwxr-sr-x    2 0        50           4096 Jul 26 22:58 pub
226 Directory send OK.
ftp>;

Step 5) Run from an inetd of some kind (optional - standalone mode is now
recommended)

You may want to run the binary from an inetd of some kind, because this can
give you extra features - e.g. xinetd has a lot of settings. (Note that
vsftpd's inbuilt listener covers most of the more useful xinetd settings).

5a) If using standard "inetd", you will need to edit /etc/inetd.conf, and add
a line such as:

ftp stream tcp nowait root /usr/sbin/tcpd /usr/local/sbin/vsftpd

(Make sure to remove or comment out any existing ftp service lines. If you
don't have tcp_wrappers installed, or don't want to use them, take out the
/usr/sbin/tcpd part).

inetd will need to be told to reload its config file:
kill -SIGHUP `pidof inetd`

5b) If using "xinetd", you can follow a provided example, by looking at the
file EXAMPLE/INTERNET_SITE/README. Various other examples show how to leverage
the more powerful xinetd features.


Step 6) Set up PAM for local logins (optional)

If you are running vsftpd on a PAM enabled machine, you will need to have a
/etc/pam.d/ftp file present, otherwise non-anonymous logins will fail. [NOTE -
if you have an older version of PAM, that file might be /etc/pam.conf]

For a standard setup, you can just copy a provided example file:
cp RedHat/vsftpd.pam /etc/pam.d/ftp


Step 7) Customize your configuration

As well as the above three pre-requisites, you are recommended to install a
config file. The default location for the config file is /etc/vsftpd.conf.
There is a sample vsftpd.conf in the distribution tarball. You probably want
to copy that to /etc/vsftpd.conf as a basis for modification, i.e.:

cp vsftpd.conf /etc

The default configuration allows neither local user logins nor anonymous
uploads. You may wish to change these defaults.

Other notes
===========

Tested platforms (well, it builds)
- Any modern, well featured platform should work fine! Recent versions of
the platforms listed below, and often older ones, should work fine.
- Fedora Core
- RedHat Linux
- RedHat Enterprise Linux
- Solaris / GNU tools (Solaris 8 or newer)
- SuSE Linux
- Debian Linux
- OpenBSD
- FreeBSD
- NetBSD
- HP-UX / GNU tools
- IRIX / GNU tools
- AIX / GNU tools
- Mac OS X (note; older versions have setgroups() problem. 10.3.4 reported OK)

论坛徽章:
0
5 [报告]
发表于 2005-04-13 20:34 |只看该作者

vsftpd架设ftp服务器 求救

若在X下,把开发工具包全装了



谢谢  装什么开发工具包?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP