How to download a file from my server using SSH (using PuTTY on Windows)

前端 未结 6 2047
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 18:41

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

(Note I am already SSH\'d into my server before typing

6条回答
  •  甜味超标
    2020-12-04 19:19

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

    Though PuTTY supports connection-sharing.

    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.

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


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

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

    Note that the scp is OpenSSH program. It's primarily *nix program, but you can run it via Windows Subsystem for Linux or get a Windows build from Win32-OpenSSH (it is already built-in in the latest versions of Windows 10).


    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).


    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.
    See Opening Session in PuTTY.

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

    (I'm the author of WinSCP)

提交回复
热议问题