windows下利用ssh复制文件到主机

本文介绍如何利用PuTTY的pscp工具进行远程文件传输,包括将文件从远程服务器接收至本地及从本地发送至远程服务器的方法。通过具体示例展示了pscp命令的使用,如从客户机(Ubuntu)接收/etc/hosts文件至本地C盘temp目录下,以及将本地文件c:documentsfoo.txt发送至服务器example.com的/tmp/目录。

使用PuTTY软件
安装路径下的pscp软件,添加此路径到环境变量

接受文件 To receive (a) file(s) from a remote server:

pscp  [options] [user@]host:source target*

例如:从客户机(Ubuntu)名:example.com,用户名:fred 文件路径: /etc/hosts
主机路径:c:\temp\example-hosts.txt

`pscp fred@example.com:/etc/hosts c:\temp\example-hosts.txt`

发送文件类似,To send (a) file(s) to a remote server:

pscp [options] source [source...] [user@]host:target

So to copy the local file c:\documents\foo.txt to the server example.com as user fred to the file /tmp/foo you would type:

pscp c:\documents\foo.txt fred@example.com:/tmp/foo

官方文档
https://the.earth.li/~sgtatham/putty/0.72/htmldoc/Chapter5.html#pscp

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值