Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

Linux 學習筆記:ProFTPD 進階配置(二)—— incoming 目錄權限控制與完整配置檔範例

編輯:關於伺服器

承上篇,進一步限制 incoming 子目錄寫入權限僅開放給特定網段,並附完整 proftpd.conf 註解版供參考。

配置 incoming 目錄權限

編輯 proftpd.conf,在 <Anonymous> 區段內 <Directory incoming> ... </Directory> 之間加入:

<Limit WRITE>
Order allow,deny
Allow from 10.0.8.
Deny from all
</Limit>

表示:10.0.8. 網段用戶擁有寫入權限,其餘全拒。若要全開放,改為 AllowAll。

常用 FTP 管理指令

  • ftpshut:關閉 FTP 服務,產生 /etc/shutmsg;刪除該檔恢復服務。
  • ftpwho:顯示線上用戶名單。
  • ftpcount:顯示線上人數。

附錄:proftpd.conf 完整註解範例

ServerName "MY REDHAT LINUX FTP"
ServerType standalone
DefaultServer on
Port 21
Umask 022
RequireValidShell off
ServerIdent off
MaxInstances 30
User nobody
Group nobody          # 原為 nogroup,必須改為 nobody
AllowOverwrite on

<Anonymous /home/ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayFirstChdir .message

<Limit WRITE>
Order allow,deny
Allow from 10.0.8.
Deny from all
</Limit>
</Anonymous>

關鍵參數說明:ServerType standalone 安全性較高;ServerIdent off 隱藏版本資訊;MaxInstances 防 DoS 限制並發;UserAlias 讓 anonymous 等同 ftp 帳號。

Copyright © Windows教程網 All Rights Reserved