使用putty上传下载文件(pscp)

putty做为ssh工具开源免费,简单易用。但是如何使用它来上传和下载文件呢?答案在于pscp。html

pscp下载地址:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html服务器

pscp是一个命令行工具,也就是说,别期望双击它来运行。你须要一个命令行工具,像window的dos,而后把目录切换到pscp.exe所在的目录。ssh

接下来就能够使用命令来上传和下载文件了。使用格式以下:工具

Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec

上传文件:spa

pscp [options] source [source...] [user@]host:target
pscp D:\source.txt root@192.168.0.3:/tmp/
//把D盘下的source.txt文件上传到192.168.0.3(个人虚拟机)这个服务器下的/tmp/目录中。

下载文件:命令行

pscp [options] [user@]host:source target
pscp root@192.168.0.3:/tmp/source.txt D:\
//192.168.0.3(个人虚拟机)这个服务器/tmp/目录下的source.txt下载到D盘下。

列出远程服务器:code

pscp -ls root@192.168.0.3:/tmp
//列出/tmp目录下的文件。

具体的参数说明,见:http://the.earth.li/~sgtatham/putty/0.63/htmldoc/Chapter5.html#pscphtm

相关文章
相关标签/搜索