




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、sftp是Secure File Transfer Protocol的縮寫,安全文件傳送協(xié)議??梢詾閭鬏斘募峁┮环N安全的加密方法。sftp 與 ftp 有著幾乎一樣的語法和功能。SFTP 為 SSH的一部分,是一種傳輸檔案至 Blogger 伺服器的安全方式。其實在SSH軟件包中,已經(jīng)包含了一個叫作SFTP(Secure File Transfer Protocol)的安全文件傳輸子系統(tǒng),SFTP本身沒有單獨的守護進程,它必須使用sshd守護進程(端口號默認是22)來完成相應(yīng)的連接操作,所以從某種意義上來說,SFTP并不像一個服務(wù)器程序,而更像是一個客戶端程序。SFTP同樣是使用加密傳輸認證
2、信息和傳輸?shù)臄?shù)據(jù),所以,使用SFTP是非常安全的。但是,由于這種傳輸方式使用了加密/解密技術(shù),所以傳輸效率比普通的FTP要低得多,如果您對網(wǎng)絡(luò)安全性要求更高時,可以使用SFTP代替FTP。一、連接方式常用的方式有兩種,一種直接采用sftp連接遠端服務(wù)器IP另一種則先登錄遠程服務(wù)器,在開啟sftp功能1、sftp remotehost IP 通過sftp連接host,端口為默認的22,用戶為Linux當(dāng)前登錄用戶。Xshell 5 (Build 0806)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Ty
3、pe help to learn how to use Xshell prompt.c:$ sftp 01Connecting to 01:22.Connection established.To escape to local shell, press Ctrl+Alt+.Your current local directory isC:UsersFieldYangDocumentsNetSarangXshellSessionsType help to browse available commnands.sftp:/root2、sftp -o
4、Port=port remotehost IP通過sftp連接遠程服務(wù)器,指定端口port,用戶為Linux當(dāng)前登錄用戶。3、sftp userremotehost IP通過sftp連接遠程服務(wù)器,端口為默認的22,指定用戶user。Xshell 5 (Build 0806)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Type help to learn how to use Xshell prompt.c:$ sftp fieldyang01Connecting to 192
5、.168.56.101:22.Connection established.To escape to local shell, press Ctrl+Alt+.Your current local directory isC:UsersFieldYangDocumentsNetSarangXshellSessionsType help to browse available commnands.sftp:/home/fieldyang4、sftp -oPort=port user remotehost IP通過sftp連接remotehost IP,端口為port,用戶為user。5、通過Xs
6、hell5與linux建立連接后,在圖形用戶面板上 窗口-傳輸新建文件,打開xftp的字符界面,如圖,直接關(guān)閉即可打開一個sftp窗口二、用法1、基本用法sftp:/root helpbye finish your SFTP session退出sftpcd change your remote working directory更改遠程服務(wù)器工作目錄clear clear screen清屏exit finish your SFTP sessionexplore explore your local directory導(dǎo)入本地目錄get download a file from the serv
7、er to your local machine從遠程服務(wù)器上下載文件到本機help give help查找?guī)椭鷏cd change and/or print local working directory切換本地當(dāng)前工作目錄lls list contents of a local directory列出本地當(dāng)前目錄的內(nèi)容lpwd print your local working directory打印當(dāng)前工作目錄ls list contents of a remote directory列出遠程服務(wù)器目錄內(nèi)容mkdir create a directory on the remote ser
8、ver在遠程服務(wù)器上創(chuàng)建一個目錄mv move or rename a file on the remote server搬移或重命名一個的遠程服務(wù)器文件put upload a file from your local machine to the server將本機的文件上傳到遠程服務(wù)器pwd print your remote working directory打印遠程服務(wù)器工作路徑quit finish your SFTP session退出rename move or rename a file on the remote server搬移或重命名一個的遠程服務(wù)器文件rm delet
9、e a file刪除一個文件rmdir remove a directory on the remote server在遠程服務(wù)器上刪除一個目錄刪除一個目錄2、常用的為上傳下載1)、get從遠程服務(wù)器上下載一個文件存放到本地,如下:先通過lcd切換到本地那個目錄下,然后通過get file lcd d: #表示切換到本地的d盤下 get ./test.sql #這樣就將當(dāng)前文件下載本地的d盤下2)、put是將本地的文件上傳到遠程服務(wù)器上,如下: put #在windows下彈出選擇文件的窗口3)、lcd先通過lcd切換到本地那個目錄下 lcd c: #表示切換到本地的c盤下4)、lls#顯示當(dāng)
10、前目錄下的所有文件5)、pwd#顯示當(dāng)前目錄 三、各個用法實例詳解實例1、從服務(wù)器下載文件到本機Xshell 5 (Build 0806)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Type help to learn how to use Xshell prompt.c:$ Connecting to 01:22.Connection established.To escape to local shell, press Ctrl+Alt+.Your current loca
11、l directory isC:UsersFieldYangDocumentsNetSarangXshellSessionsType help to browse available commnands.sftp:/root cd /mnt/share #遠程路徑切換為/mnt/sharesftp:/mnt/share ls lt drwxrwxrwx 1 1000 users 4096 Jun 16 13:39 .drwxr-xr-x 7 root root 4096 Jun 15 14:06 .-rwxrwxrwx 1 1000 users 220151 Jun 15 14:26 .gou
12、tputstream-ZHJ8IY-rwxrwxrwx 1 1000 users 19362 Jun 16 12:27 0.jpg-rwxrwxrwx 1 1000 users 16157 Jun 16 13:39 Auth Server and SOAP proxy.docx-rwxrwxrwx 1 1000 users 63952 Jun 16 12:29 bamquickinstall.pdf-rwxrwxrwx 1 1000 users 7277 Jun 16 13:33 DNSmmmS.txt-rwxrwxrwx 1 1000 users 7277 May 12 10:43 DNSS
13、.txt-rwxrwxrwx 1 1000 users 111395 Jun 15 15:46 libpcap-0.9.4-15.el5.x86_64.rpm-rwxrwxrwx 1 1000 users 363677 Jun 15 14:59 ppp-2.4.4-14.1.rhel5.x86_64.rpm-rwxrwxrwx 1 1000 users 48430 Jun 15 14:57 ppp-devel-2.4.4-14.1.rhel5.x86_64.rpm-rwxrwxrwx 1 1000 users 86211 Jun 15 15:38 pptpd-1.4.0-1.rhel4.x86
14、_64.rpm-rwxrwxrwx 1 1000 users 86509 Jun 15 14:46 pptpd-1.4.0-1.rhel5.x86_64.rpm-rwxrwxrwx 1 1000 users 220151 Jun 15 13:22 Screenshot.png-rwxrwxrwx 1 1000 users 21789 Jun 16 13:39 Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Server.docxsftp:/mnt/share lcd d:Fieldtest_sf
15、tp #切換到本地的d盤下Field文件夾的test_sftp文件夾Local directory is now d:Fieldtest_sftpsftp:/mnt/share lpwdLocal directory is d:Fieldtest_sftp#打印本地文件夾路徑sftp:/mnt/share lls06/16/2016 05:44W .06/16/2016 05:44W .#查看本地文件夾d:Fieldtest_sftp內(nèi)容sftp:/mnt/shareget ./0.jpg ./DNSmmmS.txt ./pptpd-1.4.0-1.rhel5.x86_64.rpm#下載遠程服
16、務(wù)器/mnt/share上的0.jpg 、DNSmmmS.txt 、#pptpd-1.4.0-1.rhel5.x86_64.rpm到本地文件夾d:Fieldtest_sftp中Fetching /mnt/share/./pptpd-1.4.0-1.rhel5.x86_64.rpm to pptpd-1.4.0-1.rhel5.x86_64.rpmsftp: received 84.4 KB in 0.64 secondsFetching /mnt/share/./DNSmmmS.txt to DNSmmmS.txtsftp: received 7.10 KB in 0.02 secondsFe
17、tching /mnt/share/./0.jpg to 0.jpgsftp: received 18.9 KB in 0.03 secondssftp:/mnt/share lls lt#命令行查看是否下載成功06/16/2016 05:47W .06/16/2016 05:47W .06/16/2016 05:47W 19362 0.jpg06/16/2016 05:47W 7277 DNSmmmS.txt06/16/2016 05:47W 86509 pptpd-1.4.0-1.rhel5.x86_64.rpm實例2、上傳本地文件到遠程服務(wù)器sftp:/mnt/share lcd d:F
18、ieldSNINF#切換本地路徑到d:FieldSNINFLocal directory is now d:FieldSNINFsftp:/mnt/share lpwd# 打印本地當(dāng)前路徑Local directory is d:FieldSNINFsftp:/mnt/share lls -lt02/19/2016 07:50W .02/19/2016 07:50W .12/11/2015 08:27W 16157 Auth Server and SOAP proxy.docx12/11/2015 08:27W 464191 Check Plan-Jacky.docx12/11/2015 08
19、:27W 562801 CIMDB V David.docx12/11/2015 08:27W 12031 Disk Full V For All Systems.docx12/11/2015 08:27W 126440 EMMSC-Fox.docx12/11/2015 08:27W 115928 ENUM VJacky.docx12/11/2015 08:27W 327650 F-Secure.docx12/11/2015 08:27W 107606 GDS-Fox.docx12/11/2015 08:27W 117762 GIMEIXFox.docx12/11/2015 08:27W 31
20、0862 GUP CGUP Ray.docx12/11/2015 08:27W 650939 IP call -Sharon.docx12/11/2015 08:27W 779957 Mex health check-Niker.docx12/11/2015 08:27W 124195 NetScout (DPI)XFox.docx12/11/2015 08:27W 198426 POC-Jacky.docx12/11/2015 08:27W 326368 Radius Proxy -Niker.docx12/11/2015 08:27W 190044 SMTP health check-Ni
21、ker.docx12/11/2015 08:27W 45643 Stretti DFSXSharon.docx12/11/2015 08:27W 233654 Stretti DISC VJacky.docx12/11/2015 08:27W 449498 Traffic Router Health CheckXDavid.docx12/11/2015 08:27W 21789 Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Server.docx12/11/2015 08:27W 734859
22、 Video TranscoderXDavid.docx12/11/2015 08:27W 14815 Virtual Browser.docx12/11/2015 08:27W 22554 ZMMSC.docx12/11/2015 08:27W 219776 ZProxy Fox.docx12/11/2015 08:27W 221199 ZWAPGW NZWAPGW Fox.docxsftp:/mnt/share putUploading Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Ser
23、ver.docx to remote:/mnt/share/Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Server.docxsftp: sent 21.2 KB in 0.01 seconds#在彈出的Windows框中選擇文件上傳 注意上傳路徑與當(dāng)前路徑要相同sftp:/mnt/share putUploading Virtual Browser.docx to remote:/mnt/share/Virtual Browser.docxsftp: sent 14.4 KB in 0.0
24、2 secondssftp:/mnt/share putUploading Check Plan-Jacky.docx to remote:/mnt/share/Check Plan-Jacky.docxsftp: sent 453 KB in 0.05 secondssftp:/mnt/share putUploading ZMMSC.docx to remote:/mnt/share/ZMMSC.docxsftp: sent 22.0 KB in 0.00 secondssftp:/mnt/share ls -lt drwxrwxrwx 1 1000 users 4096 Jun 16 1
25、3:54 .drwxr-xr-x 7 root root 4096 Jun 15 14:06 .-rwxrwxrwx 1 1000 users 220151 Jun 15 14:26 .goutputstream-ZHJ8IY-rwxrwxrwx 1 1000 users 19362 Jun 16 12:27 0.jpg-rwxrwxrwx 1 1000 users 16157 Jun 16 13:39 Auth Server and SOAP proxy.docx-rwxrwxrwx 1 1000 users 63952 Jun 16 12:29 bamquickinstall.pdf-rw
26、xrwxrwx 1 1000 users 464191 Jun 16 13:53 Check Plan-Jacky.docx-rwxrwxrwx 1 1000 users 7277 Jun 16 13:33 DNSmmmS.txt-rwxrwxrwx 1 1000 users 7277 May 12 10:43 DNSS.txt-rwxrwxrwx 1 1000 users 111395 Jun 15 15:46 libpcap-0.9.4-15.el5.x86_64.rpm-rwxrwxrwx 1 1000 users 363677 Jun 15 14:59 ppp-2.4.4-14.1.r
27、hel5.x86_64.rpm-rwxrwxrwx 1 1000 users 48430 Jun 15 14:57 ppp-devel-2.4.4-14.1.rhel5.x86_64.rpm-rwxrwxrwx 1 1000 users 86211 Jun 15 15:38 pptpd-1.4.0-1.rhel4.x86_64.rpm-rwxrwxrwx 1 1000 users 86509 Jun 15 14:46 pptpd-1.4.0-1.rhel5.x86_64.rpm-rwxrwxrwx 1 1000 users 220151 Jun 15 13:22 Screenshot.png-
28、rwxrwxrwx 1 1000 users 21789 Jun 16 13:52 Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Server.docx-rwxrwxrwx 1 1000 users 14815 Jun 16 13:53 Virtual Browser.docx-rwxrwxrwx 1 1000 users 22554 Jun 16 13:54 ZMMSC.docxsftp:/mnt/share實例3、在遠程服務(wù)器創(chuàng)建刪除目錄sftp:/mnt/share mkdir /mnt
29、/share/test#在遠程服務(wù)器上創(chuàng)建目錄/mnt/share/testsftp:/mnt/share cd /mnt/share/testsftp:/mnt/share/test pwd#查看是否創(chuàng)建成功Remote directory is /mnt/share/testsftp:/mnt/share/test cd /mnt/share/sftp:/mnt/share rmdir /testcannot remove /test: no such a directorysftp:/mnt/share rmdir /mnt/share/test#刪除剛創(chuàng)建的目錄/mnt/share/t
30、estsftp:/mnt/share cd /mnt/share/testcannot change to /mnt/share/test: no such a directory#確認是否刪除成功實例4、在遠程服務(wù)器刪除文件sftp:/mnt/share rm ./ZMMSC#刪除遠程服務(wù)器/mnt/share上的文件ZMMSC.docx,./表示當(dāng)前目錄cannot delete /mnt/share/./ZMMSC: no such a filesftp:/mnt/share rm ./ZMMSC.docxdeleted /mnt/share/./ZMMSC.docxsftp:/mnt/share rm ./Traffic Usage System alarm handling - Gateway, RadiusGWProxy, RadiusProxy Server.docxusage: rm filesftp:/mnt/share rm ./DNSS.txtdeleted /mnt/share/./DNSS.txtsftp:/mnt/share ls#查看是否成功刪除drwxrwxrwx 1 1000 users 4096 Jun 16 14:25 .drwxr-xr-x 7 root roo
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 深海探險起點:船舶租賃合同揭秘
- 飛行員培訓(xùn)合同合作意向范本
- 車險代理合同書樣本
- 企業(yè)員工培訓(xùn)合作協(xié)議合同
- 股權(quán)激勵實施合同協(xié)議
- 施工領(lǐng)域農(nóng)民工勞動合同模板
- 汽車購銷合同其一:條款解析
- 小學(xué)生心理課件
- 無線廣播電視傳輸中的信號傳輸信道分配考核試卷
- 天然氣儲層滲透性改善技術(shù)考核試卷
- 《天才少年維克多》
- CH:火花塞功能、結(jié)構(gòu)類型及檢測
- 信訪工作課件
- 物資盤點工作步驟與細則
- “中小學(xué)教師全員遠程培訓(xùn)”的實效性研究-以山西省J市為例的中期報告
- 工業(yè)旅游項目策劃
- 視頻監(jiān)控入門基礎(chǔ)教程視頻監(jiān)控系統(tǒng)
- 國家基本藥物臨床應(yīng)用指南1
- 自主選擇頂崗實習(xí)申請表
- 報驗申請表模板
- 《中外廣播電視史》課件
評論
0/150
提交評論