FTP服務(wù)實(shí)驗(yàn)報(bào)告_第1頁
FTP服務(wù)實(shí)驗(yàn)報(bào)告_第2頁
FTP服務(wù)實(shí)驗(yàn)報(bào)告_第3頁
FTP服務(wù)實(shí)驗(yàn)報(bào)告_第4頁
FTP服務(wù)實(shí)驗(yàn)報(bào)告_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、FTP實(shí)驗(yàn)報(bào)告1. 實(shí)驗(yàn)背景:2. 實(shí)驗(yàn)步驟:第一步:搭建環(huán)境rootredhat # mount /dev/cdrom /mnt /掛載光盤到/mnt目錄下mount: block device /dev/cdrom is write-protected, mounting read-onlyrootredhat # cd /mnt/Server/ ./切換目錄rootredhat Server# rpm -ivh vsftpd-2.0.5-10.el5.i386.rpm /安裝vsftpd軟件包warning: vsftpd-2.0.5-10.el5.i386.rpm: Header V3

2、 DSA signature: NOKEY, key ID 37017186Preparing. # 100% 1:vsftpd # 100%rootredhat Server# useradd user1 /創(chuàng)建user1系統(tǒng)賬號(hào)rootredhat Server# useradd user2 /創(chuàng)建user2系統(tǒng)賬號(hào)rootredhat Server# passwd user1 /給user1設(shè)置密碼abcChanging password for user user1.New UNIX password:BAD PASSWORD: it is WAY too shortRetype ne

3、w UNIX password:passwd: all authentication tokens updated successfully.rootredhat Server# passwd user2 /給user2設(shè)置密碼abcChanging password for user user2.New UNIX password:BAD PASSWORD: it is WAY too shortRetype new UNIX password:passwd: all authentication tokens updated successfully.ftp服務(wù)器搭建完成后開啟端口、啟動(dòng)就

4、能使用,但很危險(xiǎn),情況如下:C:Documents and Settingsstudent>ftp /命令行登陸ftpConnected to .220 (vsFTPd 2.0.5)User (:(none): user1 /用user1登陸331 Please specify the password.Password:230 Login successful.ftp> ls /查看200 PORT command successful. Consider using PASV.150 Here comes th

5、e directory listing.226 Directory send OK.ftp> cd /250 Directory successfully changed.ftp> ls200 PORT command successful. Consider using PASV.150 Here comes the directory listing.binbootdevetchomeliblost+foundmediamiscmntnetoptprocrootsbinselinuxsrvsystmpusrvar226 Directory send OK.ftp: 收到 124

6、 字節(jié),用時(shí) 0.05Seconds 2.64Kbytes/sec. ftp> get /etc/passwd /從遠(yuǎn)程主機(jī)上將獲得指定的文件到本地主機(jī)200 PORT command successful. Consider using PASV.150 Opening BINARY mode data connection for /etc/passwd (1599 bytes).226 File send OK.ftp: 收到 1599 字節(jié),用時(shí) 0.00Seconds 1599000.00Kbytes/sec.注釋:這樣很危險(xiǎn),在linux里,默認(rèn)能看見就代表能下載,而系統(tǒng)里的

7、重要資料自然就沒有絲毫的安全可言了第二步:創(chuàng)建數(shù)據(jù)庫文件rootredhat # vim login.txt /編輯login.txt文件teach123456class1123456class2123456rootredhat # db_lo /轉(zhuǎn)換數(shù)據(jù)庫文件了,可tab不出來了,裝上db4-utilsrootredhat # cd /mnt/Server/ /切換目錄rootredhat Server# rpm -ivh db4-utils-4.3.29-9.fc6.i386.rpm /安裝db4-utils軟件包warning: db4-utils-4.3.29-9.fc6.i386.r

8、pm: Header V3 DSA signature: NOKEY, key ID 37017186Preparing. # 100% 1:db4-utils # 100%rootredhat # db_load -T -t hash -f login.txt /etc/vsftpd/login.db /轉(zhuǎn)換數(shù)據(jù)庫文件第三步:rootredhat # vim /etc/pam.d/ftp.vuser /編輯驗(yàn)證文件ftp.vuserauth required 注釋:后面的忘了或根本就沒記住,wq保存退出后ls,記住大概在什么目錄下tab幾下就出來了rootredhat # ls /lib/s

9、ecurity/pam_userdb.so /lib/security/pam_userdb.sorootredhat # ls /etc/vsftpd/login.db/etc/vsftpd/login.dbrootredhat # vim /etc/pam.d/ftp.vuser /編輯驗(yàn)證文件了,復(fù)制幾下就可以了auth required /lib/security/pam_userdb.so db=/etc/vsftpd/loginaccount required /lib/security/pam_userdb.so db=/etc/vsftpd/loginrootredhat #

10、mv /home/redhat ./ /將home里的用戶redhat移動(dòng)到當(dāng)前目錄下rootredhat # ls l /查看一下,權(quán)限不變總計(jì) 68-rw- 1 root root 808 2011-02-20 anaconda-ks.cfg-rw-r-r- 1 root root 36414 2011-02-20 install.log-rw-r-r- 1 root root 3510 2011-02-20 install.log.syslog-rw-r-r- 1 root root 41 04-02 11:11 login.txtdrwx- 3 redhat redhat 4096 2

11、011-02-20 redhatrootredhat # ls /homeuser1 user2rootredhat # useradd -d /home/ftpsite vuser /創(chuàng)建一個(gè)系統(tǒng)賬號(hào),并指定給虛擬賬戶綁定rootredhat # ls /homeftpsite user1 user2第四步:編輯主配置文件rootredhat # vim /etc/vsftpd/vsftpd.confguest_enable=yesguest_username=vuserpam_service_name=ftp.vuseruser_config_dir=/etc/vsftpd/vuser_c

12、onfiganon_world_readable_only=NOrootredhat # service vsftpd restart關(guān)閉 vsftpd: 失敗為 vsftpd 啟動(dòng) vsftpd: 確定rootredhat # chkconfig vsftpd onrootredhat # chkconfig -list vsftpdvsftpd 0:關(guān)閉 1:關(guān)閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關(guān)閉第五步:rootredhat # mkdir /etc/vsftpd/vuser_configrootredhat # ls -l /etc/vsftpd/vuser_config

13、/總計(jì) 0rootredhat # vim /etc/vsftpd/vuser_config/teachlocal_root=/home/ftpsite/teach /指定虛擬賬戶登陸的主目錄anon_world_readable_only=NO / 表示用戶可以瀏覽ftp目錄和下載文件anon_upload_enable=YES /允許虛擬賬號(hào)上傳文件anon_mkdir_write_enable=YES /允許虛擬賬號(hào)創(chuàng)建目錄anon_other_write_enable=YES /表示用戶具有文件改名、刪除文件和覆蓋文件的權(quán)限deny_file=*.mp3,*.doc,.* /表示用戶無法建立以.mp3、.doc

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論