如何使用SSH从我的服务器下载文件(在Windows上使用PuTTY) [英] How to download a file from my server using SSH (using PuTTY on Windows)

查看:2435
本文介绍了如何使用SSH从我的服务器下载文件(在Windows上使用PuTTY)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试从我的服务器下载文件到我的电脑上时,它实际上将文件下载到服务器上。

When I try downloading a file from my server onto my computer, it actually downloads the file onto the server.

(注意我已经SSH服务器,然后键入此命令。我已经看过YouTube上的教程,人们正在使用他们的终端,没有SSHing到任何特定的服务器,但我不认为我可以在Windows上使用PuTTY?)

(Note I am already SSH'd into my server before typing this command. I've watched tutorials on YouTube and people are using their terminal without SSHing into any particular server, however I don't think I can do this with PuTTY on Windows?)

scp -r -P2222 kwazy@mywebsite.com:/home2/kwazy/www/utrecht-connected.nl ~/Desktop/

问题是我正在指定下载文件的位置,只有〜/ Desktop /

The problem is that I am specifying the location to download the file as only ~/Desktop/

在我的服务器中创建一个名为 Desktop 的文件夹,而不是将文件复制到我的本地

This creates a folder called Desktop in my server, instead of copying the files onto my local desktop.

我非常感谢任何帮助。

更新:

我可以在Linux上使用这个命令。

I am able to use this command on Linux.

我已成功将文件夹下载到我的桌​​面上:

I have successfully download the folder onto my desktop:

http://i.imgur.com/71ROuVN.png

我还需要深入了解我如何在Windows机器上执行此操作。

I still need insight onto how I can do this on a Windows machine.

推荐答案

没有办法启动从SSH会话返回到本地Windows的文件在PuTTY窗口中打开。

There's no way to initiate a file transfer back to/from local Windows from a SSH session opened in PuTTY window.

尽管最新版本的PuTTY(0.64及更高版本)支持连接共享。

Though the recent versions of PuTTY (0.64 and newer) supports connection-sharing.

虽然您仍然需要运行兼容的文件传输客户端( pscp psftp ),但不需要新的登录名,它将自动(如果启用)使用现有的PuTTY会话。

While you still need to run a compatible file transfer client (pscp or psftp), no new login is required, it automatically (if enabled) makes use of an existing PuTTY session.

要启用共享,请参阅:

在PuTTY工具之间共享SSH连接

To enable the sharing see:
Sharing an SSH connection between PuTTY tools.

即使没有连接共享,您仍然可以使用Windows命令行中的 psftp pscp

Even without connection-sharing, you can still use the psftp or pscp from Windows command line.

请参阅如何使用PSCP将文件从Unix机器复制到Windows机器? a>

See How to use PSCP to copy file from Unix machine to Windows machine ...?

请注意, scp 是OpenSSH程序,它没有本机Windows版本,但可以运行它通过适用于Linux的Windows子系统 CygWin

Note that the scp is OpenSSH program, which has no native Windows version, but you can run it via Windows Subsystem for Linux or CygWin.

如果你真的要将文件下载到本地桌面,您必须将目标路径指定为%USERPROFILE%\Desktop (通常可以解析为 C:\Users\username\Desktop )。

If you really want to download the files to a local desktop, you have to specify a target path as %USERPROFILE%\Desktop (what typically resolves to a path like C:\Users\username\Desktop).

替代方式是使用 WinSCP,GUI SFTP / SCP客户。当您浏览远程站点时,您可以随时使用在PuTTY中打开命令将SSH终端打开到同一站点。

Alternative way is to use WinSCP, a GUI SFTP/SCP client. While you browse the remote site, you can anytime open SSH terminal to the same site using Open in PuTTY command.

请参阅 PuTTY中的开幕式

您甚至可以使PuTTY自动导航到您正在使用WinSCP浏览的目录。

With an additional setup, you can even make PuTTY automatically navigate to the same directory you are browsing with WinSCP.

请参阅在同一目录中打开PuTTY

(我是作者WinSCP)

这篇关于如何使用SSH从我的服务器下载文件(在Windows上使用PuTTY)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆