Serv-U (現屬 SolarWinds) 是 Windows 平台經典 FTP 伺服器軟體。本文分享兩個實戰高階技巧:利用網路磁碟映射突破本地存儲限制、虛擬目錄與 NTFS 權限結合實現多租戶隔離。注意:Serv-U 6.x 後限制網路磁碟做根目錄,建議使用 5.x 版本或改用符號連結/UNC 路徑替代。
net use Z: \\10.91.30.45\H$ 198029 /user:administrator /persistent:yes
需目標主機開啟 Server 服務、啟用行政共享 (H$)、防火牆開放 445/139 連接埠、帳號具備「從網路存取此電腦」權限。Z: 在「我的電腦」顯示為「網路磁碟機」。Z:\ 或輸入 Z:\FTPRoot。\\10.91.30.45\H$\FTPRoot (Serv-U 15+ 支援)。mklink /D D:\FTPRoot \\10.91.30.45\H$\FTPRoot → Serv-U 指向 D:\FTPRoot。FTP 根目錄: D:\FTPRoot
├── Public/ (Everyone 讀取、管理員寫入)
├── Dept_A/ (群組 Dept_A_FTP 讀寫、其他無權限)
├── Dept_B/ (群組 Dept_B_FTP 讀寫、其他無權限)
├── User_John/ (John 讀寫、其他無權限)
└── Incoming/ (所有認證使用者 寫入、不可讀取/列表 - 投遞箱模式)
Public → 實體路徑:D:\FTPRoot\Public → 權限:檔案讀取、目錄列表 (無寫入/刪除/建立)。rem Public: Everyone 讀取
icacls "D:\FTPRoot\Public" /grant "Everyone:(RX)" /inheritance:r
rem Dept_A: 群組讀寫
icacls "D:\FTPRoot\Dept_A" /grant "Dept_A_FTP:(OI)(CI)(M)" /inheritance:r
rem Dept_B: 群組讀寫
icacls "D:\FTPRoot\Dept_B" /grant "Dept_B_FTP:(OI)(CI)(M)" /inheritance:r
rem User_John: 個人讀寫
icacls "D:\FTPRoot\User_John" /grant "John:(OI)(CI)(M)" /inheritance:r
rem Incoming: 投遞箱 (寫入不可讀)
icacls "D:\FTPRoot\Incoming" /grant "Authenticated Users:(OI)(CI)(WD,AD)" /inheritance:r
icacls "D:\FTPRoot\Incoming" /deny "Authenticated Users:(OI)(CI)(RX)" /inheritance:r
(OI)(CI)= 物件繼承 + 容器繼承 (遞歸至子檔案/目錄)。
M= 修改 (讀寫刪除);WD,AD= 寫入資料/新增檔案/新增目錄 (無讀取/列表/刪除)。
ls / dir Incoming 目錄 → 550 Permission denied。現代替代方案:SFTP (OpenSSH/Win32-OpenSSH) 原生支援寬頻檔案傳輸、金鑰認證、chroot 隔離、系統帳號整合、零授權成本。Windows Server 2019+ 內建 OpenSSH Server 可選功能,強烈建議新部署採用 SFTP 取代 FTP/FTPS。