如何在Windows中使用Putty将文件从远程服务器复制到服务器?
如何使用Putty会话将文件从远程服务器复制到本地Windows系统?Putty工具之一是pscp.exe;它将允许您从远程主机复制文件。它使用PSCP工作。 说明:如何在Windows中使用Putty将文件从远程服务器复制到服务器?,windows,putty,pscp,Windows,Putty,Pscp,如何使用Putty会话将文件从远程服务器复制到本地Windows系统?Putty工具之一是pscp.exe;它将允许您从远程主机复制文件。它使用PSCP工作。 说明: 从Putty页面下载PSCP.EXE 打开命令提示符并键入set PATH= 在命令提示符中,使用cd命令指向pscp.exe的位置 类型pscp 使用以下命令将文件从远程服务器复制到本地系统 pscp [options] [user@]host:source target 因此,要将文件/etc/hosts作为用户fred从
set PATH=
pscp
pscp [options] [user@]host:source target
/etc/hosts
作为用户fred
从服务器example.com
复制到文件中
c:\temp\example hosts.txt
,您可以键入:
pscp fred@example.com:/etc/hosts c:\temp\example-hosts.txt
如果需要连接到特定端口,请使用以下方法。pscp-P userid@:path/source\u file\u name c:\path\destination使用ssh密钥进行身份验证使用
-i c:\path\id\u rsa.ppk
将会话保存在putty中并使用该会话非常方便,因此在pscp中无需进行身份验证pscp sessionname:source target
,其中sessionname将替换为putty中保存的会话名称。因此无法在putty窗口中执行此操作,它必须在CMD?@hermantouthrot中使用,看起来是这样的。您需要将其与腻子分开运行。另外,我想我应该指出,如果您指定这样的完整路径:pscp,那么在Windows路径上需要双引号pi@192.168.0.123:/folder/myfile.txt“D:\Temporary\\myfile.txt”
或者,您可以始终使用WinSCP,因为它更易于使用,因为GUI的一个解决方案是使用putty配置端口转发(例如8080到8080),然后在SSH会话中运行python-msimplehttpserver 8080
。然后在本地打开浏览器并转到localhost:8080
。