安裝 proftpd 與 設定
| Posted at 十月 19, 2006 | 沒有迴響 | 沒有引用 | 2830 reads. | Size: L, M, S | Edit: P, C || Under Server. |
在研究室的電腦,通常跟學長們都是用 FTP 來傳輸檔案,當然需要設定某些資料夾的讀寫權限。但是為了方便讀寫 FAT32 的分割,所以 mount 存放檔案的這個分割時,是使用 umask=000(才可以任意讀寫)。不過這樣就變成要在 FTP 設定哪些可以讀、哪些可以寫入的時候,很不容易管理。不過剛剛發現了 proftpd 這個好東西,以前真是不識貨呀!
因為希望可以直接使用 Linux 下面的帳號密碼來登入,不過 Ubuntu 的 deb 預設並沒有 enable shadow 和 autoshadow,所以只好移除用編譯的方式。
1. 先下載檔案(例如 義守大學),並且解壓縮,進入該資料夾。
2. 接下來編譯檔案、安裝:
# sudo ./configure --prefix=/usr/local/proftpd
--enable-shadow --enable-autoshadow
--with-modules=mod_ratio:mod_readme:mod_wrap
# sudo make && make install
3. 接著需要來設定一下,請參考鳥哥的 文章。
4. 因為安裝好並沒有在 /etc/init.d/ 下面建立一個可以啟動、關閉的檔案,需要自己來一下,內容是:
#!/bin/sh
case "$1" in
start)
if [ -x /usr/local/proftpd/sbin/proftpd ]; then
/usr/local/proftpd/sbin/proftpd && echo "proftpd Started"
fi
;;
stop)
killall proftpd
;;
*)
echo "use $0 start|stop"
;;
esac
exit 0
記得要加上執行的權限「#sudo chmod 755 /etc/init.d/proftpd」。
這樣應該就可以了,以下是我的設定:
ServerName "LAB"
ServerType standalone
DefaultServer on
Port 21
User proftpd
Group nogroup
TimesGMT off
MaxInstances 30
MaxClients 50
MaxClientsPerHost 5
AllowOverwrite on
AllowStoreRestart on
PassivePorts 65400 65420
DisplayLogin /home/ajer001/file/welcome.msg
Umask 022
RootLogin off
RequireValidShell off
DefaultRoot ~ !ajer001
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Directory />
AllowOverwrite on
</Directory>
<Directory /home/ajer001/file/*>
<Limit WRITE>
Denyall
</Limit>
</Directory>
<Directory /home/ajer001/file/upload>
<Limit WRITE>
Allowall
</Limit>
</Directory>
隨機文章:
» 2007 留言板
» my VPS - LeeWare
» [Ubuntu] 安裝OSX的儷黑體(Li Hei Pro)
» Matlab 連結 C/C++ 動態函式庫
» [播放軟體] Foobar + Winamp = TTPlayer

