傻子一个

一路走来~~

 

PuTTY 提供的文件传输工具PSCP (PuTTY Secure Copy client) 基本使用说明

通过 SSH 连接,在两台机器之间安全的传输文件,可以用于任何 SSH(包括 SSH v1、SSH v2) 服务器。

PSCP 的使用

在控制台直接执行 pscp 可以看到帮助


C:\>pscp

PuTTY Secure Copy client

Release 0.58

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

 -batch   disable all interactive prompts

 -unsafe  allow server-side wildcards (DANGEROUS)

 -sftp    force use of SFTP protocol

 -scp     force use of SCP protocol

可以看出 PSCP 的使用是很简单的,把常用的几个选项说一下:

-q 安静模式,传输文件时什么也不显示,否则会显示出文件的传输进度

-P port 指定服务器的 SSH 端口,注意这个是大写字母 P,默认是 -P 22,如果主机的 SSH 端口就是 22,就不用指定了 

-l user 指定以哪个用户的身份登录主机,用户名称也可以和主机名称写在一起,用@分割开,比如:username@server 

-pw passwd 指定登录时所用的口令为:passwd

-C 表示允许压缩传输,提高传输速度

PSCP 基本用法是:

pscp -P 22 -C c:\a.txt username@server:/path/ 

例子:

1、c:\>pscp -C c:\a.bat username@server:upload/

就是把本地的c:\a.bat复制到了主机server上的用户username所在的主目录下的upload子目录中(这个路径可能是 /home/username/upload)

2、c:\>pscp -C c:\a.txt username@server:.

把本地的 C:\a.txt 复制到主机server的用户username的主目录下

3、c:\>pscp -C username@server:*.tgz c:\download

把远程主机server上的用户username主目录下的所有 *.tgz 文件拷贝到本地的 c:\download目录中,如果 SSH 版本是 SSH v1,那这个命令就会出错。

posted on 2008-09-03 14:45 老文 阅读(9650) 评论(0)  编辑  收藏 所属分类: ubuntu(linux)上应用程序相关


只有注册用户登录后才能发表评论。


网站导航:
 

导航

常用链接

留言簿(2)

随笔分类(29)

收藏夹(1)

My Work

学习文章

软件使用

最新随笔

最新评论