在ubuntu10.4服務器版本下安裝vsftp

     終於順利的按成vsftp的安裝文檔完成了對vsftp的安裝。寫下安裝的過程,希望給其他人帶來幫助,特別感謝這篇文章的作者:http://www.2cto.com/os/201110/109225.html

     1、首先,通過wget命令下載vsftp的源碼(當然,可以通過apt-get install vsftpd安裝,但是,總覺得不知對系統做了什麼,所以通過下載源碼來安裝比較安心)命令如下:

     sudo wget ftp://vsftpd.beasts.org/users/cevans/untar/vsftpd-2.0.5/* -r (之後的* 保證全部都下載 一定要加-r參數,不然會沒有下載全,僅僅下載了文件,目錄沒有下載。)

     2、之後進入目錄,使用more命令查看安裝幫助文檔INSTALL 

     #more INSTALL (空格向下,b向上)

     3、根據安裝文檔的信息,首先要先編譯,即make,鍵入

     #make 

     在make的時候可能會出現類似如下信息的錯誤

sysdeputil.c:1129: error: storage class specified for parameter 's_utent'

sysdeputil.c:1134: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

sysdeputil.c:1173: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

sysdeputil.c:1189: error: old-style parameter declarations in prototyped function definition

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:162: error: parameter name omitted

sysdeputil.c:1189: error: expected '{' at end of input

make: *** [sysdeputil.o] Error 1

根據上網查詢到的信息,是sysdeputil.c 文件出錯,需要打補丁 補丁的文件是attachment.bin。去網絡上下載attachment.bin之後鍵入命令

# patch sysdeputil.c attachment.bin

之後繼續鍵入make即可完成編譯

4、之後根據安裝文檔的提示,要添加一個nobody用戶,鍵入命令

# useradd nobody

一般情況下會有這個提示useradd: user nobody exists

5、繼續,vsftpd needs the (empty) directory /usr/share/empty in the default

所以#mkdir /usr/share/empty/

6、根據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:的提示,我們需要建立一個路徑給匿名用戶,鍵入命令 

#mkdir /var/ftp/

# useradd -d /var/ftp ftp(限定匿名用戶的目錄在/var/ftp下)

# chown root.root /var/ftp

# chown root.root /var/ftp

7、安裝make install 

根據提示

Running "make install" will try to copy the binary, man pages, etc. tosomewhere 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

          如果在安裝的時候提示系統中沒有man5和man8,則自己建立一個,即可。

      同時根據提示"make install" doesn't copy the sample config file. It is recommended you do this:

      #cp vsftpd.conf /etc

         之後Edit /etc/vsftpd.conf, and add this line at the bottom:
      listen=YES

         8、測試運行

     #/usr/local/sbin/vsftpd &

       安裝完成

    最後# 注:若要開機自動啓動vsFTPd,請在/etc/rc.d/rc.local中加入:/usr/local/sbin/vsftpd &


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章