知識(shí)點(diǎn)FTP介紹應(yīng)用場(chǎng)景FTP的權(quán)限FTP的工作模式FTP安裝部署FTP配置文件FTP客戶端訪問基于虛擬用戶配置安全的ftp

課程目標(biāo) 能" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁 > 營銷資訊 > 建站知識(shí) > FTP文件服務(wù)器

FTP文件服務(wù)器

時(shí)間:2023-02-20 11:06:01 | 來源:建站知識(shí)

時(shí)間:2023-02-20 11:06:01 來源:建站知識(shí)

FTP文件服務(wù)器: 前面我們學(xué)習(xí)了dhcp服務(wù)和dns服務(wù),本章,我們一起來學(xué)習(xí)一個(gè)文件服務(wù)器--FTP

知識(shí)點(diǎn)



課程目標(biāo)

能夠說出ftp的作用

能夠知道ftp的端口和工作模式

能夠說出ftp用戶的分類

能夠安裝部署并配置ftp

能夠說出如何連接FTP及常用命令

能夠知道ftp的虛擬用戶如何實(shí)現(xiàn)

一、FTP介紹

FTP (File transfer protocol) 是TCP/IP 協(xié)議組中的協(xié)議之一。他最主要的功能是在服務(wù)器與客戶端之間進(jìn)行文件的傳輸。FTP就是實(shí)現(xiàn)兩臺(tái)計(jì)算機(jī)之間的拷貝,從遠(yuǎn)程計(jì)算機(jī)拷貝文件至自己的計(jì)算機(jī)上,稱之為“下載 (download)”文件。將文件從自己計(jì)算機(jī)中拷貝至遠(yuǎn)程計(jì)算機(jī)上,則稱之為“上傳(upload)”文件。這個(gè)古老的協(xié)議使用的是明碼傳輸方式,且過去有相當(dāng)多的安全危機(jī)歷史。為了更安全的使用 FTP 協(xié)議,我們主要介紹較為安全但功能較少的 vsftpd(very secure File transfer protocol ) 這個(gè)軟件。FTP是一個(gè)C/S類型的軟件,F(xiàn)TP監(jiān)聽TCP端口號(hào)為21,數(shù)據(jù)端口為20。

二、應(yīng)用場(chǎng)景

下載服務(wù)器:提供對(duì)外的下載服務(wù)

文件服務(wù)器:提供上傳和下載服務(wù)

三、FTP的權(quán)限

FTP 服務(wù)器的功能除了單純的進(jìn)行文件的傳輸與管理之外,依據(jù)服務(wù)器軟件的設(shè)定架構(gòu),它還可以提供幾個(gè)主要的功能。: 不同等級(jí)的用戶身份:user, guest, anonymous FTP 服務(wù)器在默認(rèn)的情況下,依據(jù)使用者登錄的情況而分為三種不同的身份,分別是:

(1)本地用戶:系統(tǒng)中真實(shí)存在的用戶

(2)來賓, guest;

(3)匿名登錄者, anonymous

這三種身份的用戶在系統(tǒng)上面的權(quán)限差異很大!例如實(shí)體用戶取得系統(tǒng)的權(quán)限比較完整, 所以可以進(jìn)行比較多的動(dòng)作;至于匿名登錄者,大概我們就僅提供他下載資源的能力而已,并不許匿名者使用太多主機(jī)的資源! 當(dāng)然,這三種人物因?yàn)闄?quán)限的不同能夠使用的【在線命令】自然也就不相同!

四、FTP的工作模式

FTP支持兩種模式,一種方式叫做Standard (也就是 PORT方式,主動(dòng)方式),一種是 Passive (也就是PASV,被動(dòng)方式)。 Standard模式 FTP的客戶端發(fā)送 PORT 命令到FTP服務(wù)器。Passive模式FTP的客戶端發(fā)送 PASV命令到 FTP Server。

下面介紹一個(gè)這兩種方式的工作原理:

Port模式FTP 客戶端首先和FTP服務(wù)器的TCP 21端口建立連接,通過這個(gè)通道發(fā)送命令,客戶端需要接收數(shù)據(jù)的時(shí)候在這個(gè)通道上發(fā)送PORT命令。 PORT命令包含了客戶端用什么端口接收數(shù)據(jù)。在傳送數(shù)據(jù)的時(shí)候,服務(wù)器端通過自己的TCP 20端口連接至客戶端的指定端口發(fā)送數(shù)據(jù)。 FTP server必須和客戶端建立一個(gè)新的連接用來傳送數(shù)據(jù)。

Passive模式在建立控制通道的時(shí)候和Standard模式類似,但建立連接后發(fā)送的不是Port命令,而是Pasv命令。FTP服務(wù)器收到Pasv命令后,隨機(jī)打開一個(gè)高端端口(端口號(hào)大于1024)并且通知客戶端在這個(gè)端口上傳送數(shù)據(jù)的請(qǐng)求,客戶端連接FTP服務(wù)器此端口,然后FTP服務(wù)器將通過這個(gè)端口進(jìn)行數(shù)據(jù)的傳送,這個(gè)時(shí)候FTP server不再需要建立一個(gè)新的和客戶端之間的連接。

很多防火墻在設(shè)置的時(shí)候都是不允許接受外部發(fā)起的連接的,所以許多位于防火墻后或內(nèi)網(wǎng)的FTP服務(wù)器不支持PASV模式,因?yàn)榭蛻舳藷o法穿過防火墻打開FTP服務(wù)器的高端端口;而許多內(nèi)網(wǎng)的客戶端不能用PORT模式登陸FTP服務(wù)器,因?yàn)閺姆?wù)器的TCP 20無法和內(nèi)部網(wǎng)絡(luò)的客戶端建立一個(gè)新的連接,造成無法工作。

五、FTP安裝部署

約定:本實(shí)驗(yàn)中使用過的機(jī)器為centos8.0_x86_64系統(tǒng),IP地址192.168.11.16/24.請(qǐng)關(guān)閉防火墻和SELINUX。

vsftp安裝[root@localhost ~]# dnf -y install vsftpd ftp?vsftp開機(jī)啟動(dòng)[root@localhost ~]# systemctl enable vsftpdCreated symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.?啟動(dòng)vsftp服務(wù)[root@localhost ~]# systemctl start vsftpd?驗(yàn)證啟動(dòng)[root@localhost ~]# lsof -i :21COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEvsftpd 1951 root 4u IPv6 32837 0t0 TCP *:ftp (LISTEN)

六、FTP配置文件

6.1)相關(guān)文件

主配文件:/etc/vsftpd/vsftpd.conf

下載目錄:/var/ftp/

FTP日志:/var/log/xferlog

6.2)主配文件詳解

# Example config file /etc/vsftpd/vsftpd.conf## The default compiled in settings are fairly paranoid. This sample file# loosens things up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.## READ THIS: This example file is NOT an exhaustive list of vsftpd options.# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's# capabilities.##匿名用戶訪問,YES是允許,NO是拒絕# Allow anonymous FTP? (Beware - allowed by default if you comment this out).anonymous_enable=NO## Uncomment this to allow local users to log in.# 本地用戶登錄,YES是允許,NO是拒絕.默認(rèn)訪問的是本地用戶家目錄,如果你開啟了selinux# 請(qǐng)?jiān)O(shè)置開啟布爾值ftp_home_dir為ON# When SELinux is enforcing check for SE bool ftp_home_dirlocal_enable=YES##允許本地用戶上傳# Uncomment this to enable any form of FTP write command.write_enable=YES## Default umask for local users is 077. You may wish to change this to 022,# 上傳的權(quán)限是022,使用的是umask權(quán)限。對(duì)應(yīng)的目錄是755,文件是644# if your users expect that (022 is used by most other ftpd's)local_umask=022?## Uncomment this to allow the anonymous FTP user to upload files. This only# has an effect if the above global write enable is activated. Also, you will# obviously need to create a directory writable by the FTP user.# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access# 開啟匿名用戶上傳功能,默認(rèn)是拒絕的#anon_upload_enable=YES## Uncomment this if you want the anonymous FTP user to be able to create# new directories.# 開啟匿名用戶創(chuàng)建文件或文件夾權(quán)限#anon_mkdir_write_enable=YES## Activate directory messages - messages given to remote users when they# go into a certain directory.# 開啟目錄歡迎消息,一般對(duì)命令行登陸有效dirmessage_enable=YES## Activate logging of uploads/downloads.# 開啟上傳和下載日志記錄功能xferlog_enable=YES##使用標(biāo)準(zhǔn)模式# Make sure PORT transfer connections originate from port 20 (ftp-data).connect_from_port_20=YES## If you want, you can arrange for uploaded anonymous files to be owned by# a different user. Note! Using "root" for uploaded files is not# recommended!# 聲明匿名用戶上傳文件的所有者# 允許更改匿名用戶上傳文件的所有者#chown_uploads=YES#所有者為whoever#chown_username=whoever## You may override where the log file goes if you like. The default is shown# below.# 日志文件路徑#xferlog_file=/var/log/xferlog## If you want, you can have your log file in standard ftpd xferlog format.# Note that the default log file location is /var/log/xferlog in this case.# 日志文件采用標(biāo)準(zhǔn)格斯xferlog_std_format=YES## You may change the default value for timing out an idle session.# 會(huì)話超時(shí)時(shí)間#idle_session_timeout=600## You may change the default value for timing out a data connection.# 數(shù)據(jù)傳輸超時(shí)時(shí)間#data_connection_timeout=120## It is recommended that you define on your system a unique user which the# ftp server can use as a totally isolated and unprivileged user.# FTP子進(jìn)程管理用戶#nopriv_user=ftpsecure## Enable this and the server will recognise asynchronous ABOR requests. Not# recommended for security (the code is non-trivial). Not enabling it,# however, may confuse older FTP clients.# 是否允許客戶端發(fā)起“async ABOR”請(qǐng)求,該操作是不安全的默認(rèn)禁止。#async_abor_enable=YES## By default the server will pretend to allow ASCII mode but in fact ignore# the request. Turn on the below options to have the server actually do ASCII# mangling on files when in ASCII mode. The vsftpd.conf(5) man page explains# the behaviour when these options are disabled.# Beware that on some FTP servers, ASCII support allows a denial of service# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd# predicted this attack and has always been safe, reporting the size of the# raw file.# ASCII mangling is a horrible feature of the protocol.# 該選項(xiàng)用于指定是否允許上傳時(shí)以ASCII模式傳輸數(shù)據(jù)#ascii_upload_enable=YES#該選項(xiàng)用于指定是否允許下載時(shí)以ASCII模式傳輸數(shù)據(jù)#ascii_download_enable=YES## You may fully customise the login banner string:# FTP文本界面登陸歡迎詞#ftpd_banner=Welcome to blah FTP service.## You may specify a file of disallowed anonymous e-mail addresses. Apparently# useful for combatting certain DoS attacks.# 是否開啟拒絕的Email功能#deny_email_enable=YES# (default follows)# 指定保存被拒接的Email地址的文件#banned_email_file=/etc/vsftpd/banned_emails## You may specify an explicit list of local users to chroot() to their home# directory. If chroot_local_user is YES, then this list becomes a list of# users to NOT chroot().# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that# the user does not have write access to the top level directory within the# chroot)# 是否開啟對(duì)本地用戶chroot的限制,YES為默認(rèn)所有用戶都不能切出家目錄,NO代表默認(rèn)用戶都可以切出家目錄# 設(shè)置方法類似于:YES拒絕所有,允許個(gè)別 NO 允許所有拒絕個(gè)別#chroot_local_user=YES#開啟特例列表#chroot_list_enable=YES# (default follows)# 如果chroot_local_user的值是YES則該文件中的用戶是可以切出家目錄,如果是NO,該文件中的用戶則不能切出家目錄# 一行一個(gè)用戶。#chroot_list_file=/etc/vsftpd/chroot_list## You may activate the "-R" option to the builtin ls. This is disabled by# default to avoid remote users being able to cause excessive I/O on large# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume# the presence of the "-R" option, so there is a strong case for enabling it.# 是否開啟ls 遞歸查詢功能 ls -R#ls_recurse_enable=YES## When "listen" directive is enabled, vsftpd runs in standalone mode and# listens on IPv4 sockets. This directive cannot be used in conjunction# with the listen_ipv6 directive.# 是否開啟ftp獨(dú)立模式在IPV4listen=NO## This directive enables listening on IPv6 sockets. By default, listening# on the IPv6 "any" address (::) will accept connections from both IPv6# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6# sockets. If you want that (perhaps because you want to listen on specific# addresses) then you must run two copies of vsftpd with two configuration# files.# Make sure, that one of the listen options is commented !!# 是否開啟ftp獨(dú)立模式在ipv6listen_ipv6=YES??#啟用pam模塊驗(yàn)證pam_service_name=vsftpd#是否開啟userlist功能.?#是否啟用用戶列表功能userlist_enable=YES通過配置文件的分析,VSFTP不允許匿名訪問,本地用戶可以下載和上傳。如果允許匿名用戶登錄的話需要將anonymous_enable=YES,然后重新啟動(dòng)服務(wù)

我們可以通過修改配置文件的內(nèi)容即可配置FTP的相關(guān)登陸情況。

七、FTP客戶端訪問

FTP是一個(gè)C/S類型的軟件,連接服務(wù)端需要FTP客戶端才能完成,常見的FTP客戶端有以下幾種:

瀏覽器:可以通過瀏覽器中輸入 ftp://ip或者ftp://域名的方式來訪問FTP

自帶客戶端:命令行下可以使用ftp命令去連接

三方客戶端:FileZilla 8uftp 圖形軟件或者文本界面的lftp等

三種方式中,文本界面是比較麻煩的,無法鼠標(biāo)流。所以我重點(diǎn)給大家講解一下

7.1)文本界面登陸

文本界面匿名登陸[root@localhost ~]# ftp 192.168.11.16Connected to 192.168.11.16 (192.168.11.16).220 (vsFTPd 3.0.3)Name (192.168.11.16:root): ftp #用戶名可以是ftp也可以是anonymous331 Please specify the password.Password: #密碼為空230 Login successful. #顯示登陸成功Remote system type is UNIX.Using binary mode to transfer files.ftp> ls227 Entering Passive Mode (192,168,11,16,90,35).150 Here comes the directory listing.drwxr-xr-x 2 0 0 6 May 14 2019 pub226 Directory send OK.通過ls可以列出當(dāng)前目錄下有哪些內(nèi)容 看到有一個(gè)目錄叫pubftp> pwd257 "/" 通過pwd命令查看當(dāng)前路徑 注意這里顯示的是FTP的根目錄?ftp> bye221 Goodbye.退出使用bye命令?文本界面本地用戶登錄[root@localhost ~]# ftp 192.168.11.16Connected to 192.168.11.16 (192.168.11.16).220 (vsFTPd 3.0.3)Name (192.168.11.16:root): hello331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> ls227 Entering Passive Mode (192,168,11,16,130,240).150 Here comes the directory listing.drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 下載drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 公共drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 圖片drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 文檔drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 桌面drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 模板drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 視頻drwxr-xr-x 2 1001 1001 6 Jan 15 08:56 音樂226 Directory send OK.ftp> pwd257 "/home/hello" is the current directory

7.2)FTP客戶端常用命令

鍵入help命令可以查看所有可使用的命令ftp> helpCommands may be abbreviated. Commands are:?! debug mdir sendport site$ dir mget put sizeaccount disconnect mkdir pwd statusappend exit mls quit structascii form mode quote systembell get modtime recv suniquebinary glob mput reget tenexbye hash newer rstatus tickcase help nmap rhelp tracecd idle nlist rename typecdup image ntrans reset userchmod lcd open restart umaskclose ls prompt rmdir verbosecr macdef passive runique ?delete mdelete proxy send??!+linux命令 執(zhí)行系統(tǒng)命令!ls /opt 顯示linux系統(tǒng)中/opt目錄下的內(nèi)容ftp> !ls /optdhcp dns rh??lcd linux系統(tǒng)中的當(dāng)前目錄lcd /root 將linux系統(tǒng)中的當(dāng)前目錄切換到/root下ftp> lcd /rootLocal directory now /root??put 上傳命令,mput批量上傳命令上傳initial-setup-ks.cfg文件到hello家目錄下ftp> put initial-setup-ks.cfg local: initial-setup-ks.cfg remote: initial-setup-ks.cfg227 Entering Passive Mode (192,168,11,16,96,132).150 Ok to send data.226 Transfer complete.1803 bytes sent in 0.00135 secs (1333.58 Kbytes/sec)可以看到上傳成功了?驗(yàn)證一下上傳結(jié)果ftp> ls227 Entering Passive Mode (192,168,11,16,173,142).150 Here comes the directory listing.-rw-r--r-- 1 1000 1000 1803 Feb 26 07:01 initial-setup-ks.cfgdrwxr-xr-x 2 1000 1000 6 Jan 11 01:37 下載drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 公共drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 圖片drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 文檔drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 桌面drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 模板drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 視頻drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 音樂226 Directory send OK.看見了吧?切換linux當(dāng)前目錄到/tmpftp> lcd /tmpLocal directory now /tmp???get下載命令mget批量下載下載initial-setup-ks.cfg到linux系統(tǒng)當(dāng)前目錄/tmpftp> get initial-setup-ks.cfglocal: initial-setup-ks.cfg remote: initial-setup-ks.cfg227 Entering Passive Mode (192,168,11,16,229,134).150 Opening BINARY mode data connection for initial-setup-ks.cfg (1803 bytes).226 Transfer complete.1803 bytes received in 2.9e-05 secs (62172.41 Kbytes/sec)?列出linux目錄/tmp的內(nèi)容,看到了下載的文件initial-setup-ks.cfgftp> !ls /tmp/dhcp tracker-extract-files.0initial-setup-ks.cfg VMwareDnDsystemd-private-8e7a99ea89c14ab396d66116970fe04d-chronyd.service-sghHHs vmware-rootsystemd-private-8e7a99ea89c14ab396d66116970fe04d-colord.service-wK7h08 yum_save_tx.2019-02-20.16-10.Z6uXqR.yumtxsystemd-private-8e7a99ea89c14ab396d66116970fe04d-cups.service-cokBro yum_save_tx.2019-02-21.09-03.08zIbU.yumtxsystemd-private-8e7a99ea89c14ab396d66116970fe04d-rtkit-daemon.service-6wt1S0 yum_save_tx.2019-02-22.11-10.prawAT.yumtx?ftp> close221 Goodbye.ftp> lsNot connected.可以使用close斷開連接當(dāng)連接斷開希望再次連接直接使用open命令即可ftp> open 192.168.11.16Connected to 192.168.11.16 (192.168.11.16).220 (vsFTPd 3.0.2)Name (192.168.11.16:root): hello331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> ls227 Entering Passive Mode (192,168,11,16,192,88).150 Here comes the directory listing.-rw-r--r-- 1 1000 1000 1803 Feb 26 07:01 initial-setup-ks.cfgdrwxr-xr-x 2 1000 1000 6 Jan 11 01:37 下載drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 公共drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 圖片drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 文檔drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 桌面drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 模板drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 視頻drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 音樂226 Directory send OK.???delete命令可以刪除屬于自己的文件刪除initial-setup-ks.cfg文件ftp> delete initial-setup-ks.cfg250 Delete operation successful.ftp> ls227 Entering Passive Mode (192,168,11,16,168,142).150 Here comes the directory listing.drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 下載drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 公共drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 圖片drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 文檔drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 桌面drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 模板drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 視頻drwxr-xr-x 2 1000 1000 6 Jan 11 01:37 音樂226 Directory send OK.

八、基于虛擬用戶配置安全的ftp

在ftp中不論是匿名用戶還是實(shí)名用戶都是系統(tǒng)中真實(shí)存在的用戶,或多或少都會(huì)有一些安全方面的風(fēng)險(xiǎn),為了避免這個(gè)風(fēng)險(xiǎn),開發(fā)者在ftp中加入了一個(gè)虛擬用戶的概念,所有虛擬用戶都會(huì)被統(tǒng)一映射為一個(gè)系統(tǒng)賬號(hào),免去了管理過多賬戶的麻煩,那么這個(gè)虛擬用戶如何實(shí)現(xiàn)呢?

a、修改配置文件 [root@hello pam.d]# egrep -v "^#" /etc/vsftpd/vsftpd.conf anonymous_enable=YESlocal_enable=YESwrite_enable=YESlocal_umask=022dirmessage_enable=YESxferlog_enable=YESconnect_from_port_20=YESxferlog_std_format=YESchroot_local_user=YESlisten=NOlisten_ipv6=YES??#虛擬用戶配置選項(xiàng)#pam登陸驗(yàn)證pam_service_name=vftp#允許虛擬用戶功能guest_enable=YES#虛擬用戶映射到本地用戶helloguest_username=hello#這里我通過指令改變了默認(rèn)設(shè)置,允許虛擬用戶寫allow_writeable_chroot=YES ?#本地用戶的根目錄#這里是定義虛擬用戶主目錄,用戶和組必須指定為宿主用戶hellolocal_root=/home/hello??#允許虛擬用戶和本地用戶權(quán)限一致virtual_use_local_privs=YES?#如果虛擬用戶和本地用戶權(quán)限不同,可以通過以下的指令來設(shè)置指令,配置文件和登陸名同步即可。#user_config_dir=/etc/vsftpd/vconf.d/????b生成虛擬用戶賬號(hào)密碼文件奇數(shù)行數(shù)賬戶,偶數(shù)行是密碼[root@hello ~]# cat /etc/vsftpd/vuservuser01123456vuser02123456?使用db_load轉(zhuǎn)成db格式[root@hello ~]# db_load -T -t hash -f /etc/vsftpd/vuser /etc/vsftpd/vuser.db要求權(quán)限是600[root@hello ~]# chmod 600 /etc/vsftpd/vuser.db?c、配置pam認(rèn)證,注意先后順序[root@hello ~]# cat /etc/pam.d/vftp #虛擬用戶登錄auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vuseraccount sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser#本地登陸session optional pam_keyinit.so force revokeauth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeedauth required pam_shells.soauth include password-authaccount include password-authsession required pam_loginuid.sosession include password-auth???d、重啟服務(wù)生效[root@hello ~]# systemctl restart vsftpd[root@hello ~]# cat /etc/vsftpd/chroot_list vuser01vuser02?e、驗(yàn)證登陸[root@hello ~]# ftp 192.168.11.16Connected to 192.168.11.16 (192.168.11.16).220 Welcome to ayitula FTP service.Name (192.168.11.16:root): vuser01331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> ls227 Entering Passive Mode (192,168,11,16,82,91).150 Here comes the directory listing.226 Transfer done (but failed to open directory).??登陸成功了.

章總結(jié)

FTP的作用及應(yīng)用場(chǎng)景

FTP用戶的分類、工作模式

如何去安裝部署FTP

配置文件中各字段的含義

客戶端如何訪問、如何操作

如何配置虛擬用戶

重點(diǎn):ftp的用戶分類、工作模式、安裝部署、相關(guān)文件及作用、如何去訪問

難點(diǎn):要注意配置文件的格式,訪問的時(shí)候都可以使用哪些命令,虛擬用戶如何實(shí)現(xiàn)



關(guān)鍵詞:服務(wù),文件

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉