ftp:File Transfer Protocol
21/tcp:
文件共享服務(wù):應(yīng)用層,ftp
NFS: Network File System (RPC: Remote Procedure Call, 遠(yuǎn)程過程調(diào)用)
Samba: CIFS/SMB
FTP: tcp, 兩個(gè)連接
命令連接,控制連接:21/tcp
數(shù)據(jù)連接:
主動(dòng)模式:20/tcp
被動(dòng)模式:端口隨機(jī)
數(shù)據(jù)傳輸模式(自動(dòng)模式):
二進(jìn)制:
文本:
ftp server --> ftp client
數(shù)據(jù)類型:
結(jié)構(gòu)化數(shù)據(jù)
半結(jié)構(gòu)化數(shù)據(jù)
非結(jié)構(gòu)化數(shù)據(jù)
服務(wù)器端程序:
wu-ftpd:
vsftpd: Very Secure ftp Daemon
proftpd:
pureftpd
Filezilla
Serv-U
客戶端程序:
CLI:
ftp:
lftp:
GUI:
gftpd
Flashfxp
Cuteftp
Filezilla
vsftpd:
/etc/vsftpd: 配置文件目錄
/etc/init.d/vsftpd: 服務(wù)腳本
/usr/sbin/vsftpd: 主程序
基于PAM實(shí)現(xiàn)用戶認(rèn)證:
/etc/pam.d/*
/lib/security/*
/lib64/security/*
支持虛擬用戶vsftpd: (ftp, ftp)
/var/ftp:ftp服務(wù)根目錄
ftp:系統(tǒng)用戶
匿名用戶(anonymous) --> 系統(tǒng)用戶:anonymous_enable
系統(tǒng)用戶:local_enable
虛擬用戶 -->系統(tǒng)用戶
/var/ftp: ftp用戶的家目錄
匿名用戶訪問目錄
chroot: 禁錮用戶于其家目錄中
系統(tǒng)用戶:
write_enable=YES: 上傳文件
文件服務(wù)權(quán)限:文件系統(tǒng)權(quán)限*文件共享權(quán)限
守護(hù)進(jìn)程:
獨(dú)立守護(hù):適用于訪問量大,用戶在線時(shí)間長(zhǎng)的用戶
瞬時(shí)守護(hù)
由xinetd代為管理
vsftpd:
max_clients=# 最多允許同時(shí)多少個(gè)請(qǐng)求
max_per_ip=# 同一個(gè)IP同時(shí)發(fā)起幾個(gè)請(qǐng)求
安全通信方式:
ftps:ftp+ssl/tls
sftp:OpenSSH ,subsystem,sftp(SSH)
vsftpd:PAM(手動(dòng)定義配置文件)
匿名
本地
虛擬用戶
mysql:vsftpd,users: name,password
/etc/vsftpd/vusers:-->db_load
username
password
db4+utils安裝包提供password密碼