Using putty to scp from windows to Linux

后端 未结 3 1533
孤街浪徒
孤街浪徒 2020-12-07 22:08

I\'m trying to test some C code that I\'m writing. The only issue is that the code needs to be executed on a remote machine. My laptop is pretty old, and there is no driver

相关标签:
3条回答
  • 2020-12-07 22:40

    Use scp priv_key.pem source user@host:target if you need to connect using a private key.

    or if using pscp then use pscp -i priv_key.ppk source user@host:target

    0 讨论(0)
  • 2020-12-07 22:44

    You can use PSCP to copy files from Windows to Linux.

    1. Download PSCP from putty.org
    2. Open cmd in the directory with pscp.exe file
    3. Type command pscp source_file user@host:destination_file

      • Ex.
        pscp sample.txt myuser@myhost.com:/mydata/sample.txt

    Reference

    0 讨论(0)
  • 2020-12-07 22:54

    You need to tell scp where to send the file. In your command that is not working:

    scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~
    

    You have not mentioned a remote server. scp uses : to delimit the host and path, so it thinks you have asked it to download a file at the path \Users\Admin\Desktop\WMU\5260\A2.c from the host C to your local home directory.

    The correct upload command, based on your comments, should be something like:

    C:\> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:
    

    If you are running the command from your home directory, you can use a relative path:

    C:\Users\Admin> pscp Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:
    

    You can also mention the directory where you want to this folder to be downloaded to at the remote server. i.e by just adding a path to the folder as below:

    C:/> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:/home/path_to_the_folder/
    
    0 讨论(0)
提交回复
热议问题