Windows -> Linux 檔案傳輸

xchui702發表於2014-02-08

  當下,一般Linux的預設安裝不再安裝FTP或VSFTP,但是會安裝SSH 包。在這種情況如何利用SSH協議來傳輸檔案了?

  以PUTTY客戶端工具為例,描述一下如果使用SSH協議來從Windows傳輸檔案到Linux.

--ftp方式
D:\bdwork\客戶端工具>dir
 Volume in drive D is New Volume
 Volume Serial Number is 14A7-2CEC

 Directory of D:\bdwork\客戶端工具

2013/12/27  16:21   

          .
2013/12/27  16:21              ..
2013/08/08  10:14               101 999網址導航.htm
2013/08/07  08:08           147,456 PAGEANT.EXE
2013/08/07  08:08           311,296 PLINK.EXE
2013/08/07  08:08           323,584 PSCP.EXE
2013/08/07  08:08           335,872 PSFTP.EXE
2013/08/07  08:08           448,314 PUTTY.CHM
2013/08/07  08:08            32,240 PUTTY.CNT
2013/08/07  08:08           495,616 PUTTY.EXE
2013/08/07  08:08           658,619 PUTTY.HLP
2013/08/07  08:08           184,320 PUTTYGEN.EXE
2013/08/08  10:14             3,761 下載吧下載說明.htm
              11 File(s)      2,941,179 bytes
               2 Dir(s)  25,002,823,680 bytes free

 

D:\bdwork\客戶端工具>psftp 10.64.38.136
login as: root
password:
Remote working directory is /root
psftp> cd /u01/software
Remote directory is now /u01/software
psftp> bin
psftp: unknown command "bin"
psftp> help
!      run a local command
bye    finish your SFTP session
cd     change your remote working directory
chmod  change file permissions and modes
close  finish your SFTP session but do not quit PSFTP
del    delete files on the remote server
dir    list remote files
exit   finish your SFTP session
get    download a file from the server to your local machine
help   give help
lcd    change local working directory
lpwd   print local working directory
ls     list remote files
mget   download multiple files at once
mkdir  create directories on the remote server
mput   upload multiple files at once
mv     move or rename file(s) on the remote server
open   connect to a host
put    upload a file from your local machine to the server
pwd    print your remote working directory
quit   finish your SFTP session
reget  continue downloading files
ren    move or rename file(s) on the remote server
reput  continue uploading files
rm     delete files on the remote server
rmdir  remove directories on the remote server
psftp> put D:\work\WII\MYSQL\software\V38183-01.zip
local:D:\work\WII\MYSQL\software\V38183-01.zip => remote:/u01/software/V38183-01
.zip
psftp> quit


--透過scp
D:\bdwork\客戶端工具>pscp
PuTTY Secure Copy client
Release 0.63
Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
  -V        print version information and exit
  -pgpfp    print PGP key fingerprints and exit
  -p        preserve file attributes
  -q        quiet, don't show statistics
  -r        copy directories recursively
  -v        show verbose messages
  -load sessname  Load settings from saved session
  -P port   connect to specified port
  -l user   connect with specified username
  -pw passw login with specified password
  -1 -2     force use of particular SSH protocol version
  -4 -6     force use of IPv4 or IPv6
  -C        enable compression
  -i key    private key file for authentication
  -noagent  disable use of Pageant
  -agent    enable use of Pageant
  -batch    disable all interactive prompts
  -unsafe   allow server-side wildcards (DANGEROUS)
  -sftp     force use of SFTP protocol
  -scp      force use of SCP protocol

D:\bdwork\客戶端工具>pscp D:\work\WII\MYSQL\software\mysql-cluster-advanced-7.3.
3-linux-glibc2.5-x86_64.zip
password:
mysql-cluster-advanced-7. | 461532 kB | 9419.0 kB/s | ETA: 00:00:00 | 100%

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/674865/viewspace-1078069/,如需轉載,請註明出處,否則將追究法律責任。

相關文章