自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Ubuntu下安裝proFTPd

運(yùn)維 系統(tǒng)運(yùn)維
Ubuntu 下安裝proFTPd:ProFTPD目標(biāo)是實(shí)現(xiàn)一個(gè)安全且易于設(shè)定的FTP Server,Proftpd不僅針對(duì)Wu-Ftp改進(jìn)了許多問(wèn)題,而且還有許多新的功能。那么怎樣在Ubuntu下安裝proFTPd支持呢?本文將一一簡(jiǎn)述如何Ubuntu下安裝proFTPd。

  Ubuntu9.10安裝proFTPd支持SFTP

  目的

  1)支持SFTP協(xié)議

  2)不采用系統(tǒng)帳號(hào)驗(yàn)證方式,改為數(shù)據(jù)庫(kù)MySQL驗(yàn)證

  3)數(shù)據(jù)庫(kù)中不保存密碼,只保存經(jīng)過(guò)sha256算法加密過(guò)的可打印16位小寫(xiě)字符串,系統(tǒng)中還需保存一個(gè)salt文件

  4)數(shù)據(jù)庫(kù)中指定用戶目錄,proFTPd能夠動(dòng)態(tài)創(chuàng)建用戶目錄

  修改ssh服務(wù)端口號(hào)為21

  修改文件中的配置/etc/ssh/sshd_config

  然后重新啟動(dòng)ssh服務(wù)

  sudo /etc/init.d/ssh restart

  這不會(huì)影響ssh的使用,客戶端需要用-p參數(shù)指明端口號(hào)

  創(chuàng)建ftp系統(tǒng)帳號(hào)

  1.   sudo groupadd ftp  
  2.  
  3.   sudo useradd -u 1005 -s /bin/false -d /bin/null -c "proftpd user" -g ftp ftpuser  
  4.  
  5.   sudo passwd ftp  
  6.  

  依賴庫(kù)

  確保UBuntu系統(tǒng)中已經(jīng)有/usr/include/mysql/mysql.h和/usr/lib/libmysqlclient.a

  獲得源代碼編譯安裝

  注意,系統(tǒng)中不能存在其他占用22端口的程序。

  1.   cd /usr/src  
  2.  
  3.   sudo wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3rc3.tar.gz  
  4.  
  5.   sudo tar xvzf proftpd-1.3.3rc3.tar.gz  
  6.  
  7.   cd proftpd-1.3.3rc3  
  8.  
  9.   install_user=ftp install_group=ftp sudo ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run --mandir=/usr/local/man --without-pam --disable-auth-pam --enable-openssl --with-modules=mod_ratio:mod_readme:mod_sftp:mod_sql:mod_sql_passwd:mod_sql_mysql --with-includes=/usr/include/mysql --with-libraries=/usr/lib  
  10.  
  11.   sudo make  
  12.  
  13.   sudo make install  
  14.  

  編譯成功后,當(dāng)前目錄和/usr/sbin/下都有proftpd程序。

  修改配置

  修改配置文件/etc/proftd.conf文件,在文件開(kāi)頭添加如下配置

  1.   ServerName "ProFTPD Default Installation"  
  2.  
  3.   ServerType standalone  
  4.  
  5.   DefaultServer on  
  6.  
  7.   RootLogin off  
  8.  
  9.   RequireValidShell off  
  10.  
  11.   DefaultRoot ~  
  12.  
  13.   IdentLookups off  
  14.  
  15.   UseReverseDns off  
  16.  
  17.   CreateHome on  
  18.  

  

  1.   SQLPasswordEngine on 
  2.  
  3.   SQLPasswordEncoding hex  
  4.  
  5.   SQLPasswordSaltFile /home/chenshu/salt  
  6.  

  

  

  1.   # Other mod_sql configuration here  
  2.  
  3.   SQLBackend mysql  
  4.  
  5.   SQLAuthTypes SHA256  
  6.  
  7.   SQLAuthenticate users*  
  8.  
  9.   SQLConnectInfo databaseName @IP :3306 username password 30  
  10.  
  11.   SQLDefaultUID 1003  
  12.  
  13.   SQLDefaultGID 1005  
  14.  
  15.   SQLUserInfo users login password_hash NULL NULL homedir NULL 
  16.  
 
  1.   SFTPEngine on 
  2.  
  3.   SFTPLog /etc/sftp.log  
  4.  
  5.   SFTPAuthMethods password 
  6.  
  7.   # Host keys, for server host authentication  
  8.  
  9.   SFTPHostKey /etc/ssh/ssh_host_rsa_key  
  10.  
  11.   SFTPHostKey /etc/ssh/ssh_host_dsa_key  
  12.  

      # Port 21 is the standard FTP port.

      Port 22

  

  創(chuàng)建數(shù)據(jù)表

  1.   CREATE TABLE `users` (  
  2.  
  3.   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,  
  4.  
  5.   `login` varchar(16) NOT NULL,  
  6.  
  7.   `password_hash` varchar(80) NOT NULL,  
  8.  
  9.   `homedir` varchar(1024) NOT NULL,  
  10.  
  11.   PRIMARY KEY (`id`)  
  12.  
  13.   )  
  14.  

  制造數(shù)據(jù):

  下面是Ruby代碼:

  require 'digest/sha2'

  puts Digest::SHA256.hexdigest("770328" + "7wjCeqX/")

  "770328"是用戶密碼

  "7wjCeqX/"是salt,也應(yīng)該保存在/home/chenshu/salt文件中。請(qǐng)不要在文件中添加換行符。

  算出的字符串,保存到password_hash列中。

  homedir字段保存用戶目錄,如果第一次登錄時(shí)沒(méi)有,會(huì)自動(dòng)創(chuàng)建。

  最后啟動(dòng)服務(wù):

  1.   chenshu@chenshu-desktop:/usr/sbin$ sudo ./proftpd  
  2.  

  測(cè)試,通過(guò)。這樣就完成了Ubuntu9.10下proFTPd的安裝。

【編輯推薦】

  1. ProFTPD.conf的詳細(xì)配置方法
  2. Proftpd配置文件結(jié)構(gòu)分析
  3. ProFTP下的參數(shù)說(shuō)明
  4. Porftpd.conf的配置格式
  5. lampp的ProFTPd下新增FTP用戶的方法
  6. Debian下配置ProFTPd服務(wù)器
  7. Centos下ProFTPD配置FTP服務(wù)器
責(zé)任編輯:zhaolei 來(lái)源: CSDN
相關(guān)推薦

2011-03-03 14:47:35

2011-03-03 09:04:25

2011-02-25 14:35:06

ubuntuproftp安裝

2011-03-03 11:06:44

Ubuntu安裝ProFTPD

2011-02-23 09:47:07

UbuntuProFTPdMySQL

2011-02-23 09:47:07

2011-03-08 17:04:10

ProFTPDUbuntu

2011-02-22 16:24:30

2011-03-03 13:32:07

Proftpd安裝

2011-03-02 09:26:26

ubuntuproftpd

2011-02-25 15:38:12

ProftpdRedHat

2011-02-25 15:38:58

2011-02-25 15:55:25

unixProftpd

2011-03-08 10:10:37

Linuxproftpd

2011-02-25 09:44:51

怎樣安裝Proftpd

2011-02-22 09:50:01

2011-03-03 13:07:13

安裝Proftpd

2011-03-07 17:24:33

ProFTPD安裝

2011-02-23 10:43:17

2011-02-24 14:47:48

ProFTPD
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)