linuxwindowsraspberry-pi2qemupscp

File transfer on Raspberry Pi using pscp


I am trying to send file from windows local system to QEMU raspberry pi emulator.But every time I am getting "access denied".I have downloded pscp.exe. I have tried the following commands:

pscp.exe -scp myfile.txt pi@192.168.1.3:/home/pi

pscp.exe -scp myfile.txt pi@192.168.1.3:~/home/pi

pscp.exe -scp myfile.txt pi@192.168.1.3:~/Desktop

pscp.exe -scp myfile.txt pi@192.168.1.3:~

Every time it's giving Access Denied.Please tell me where I am going wrong.


Solution

  • I am probably late, but anyway this may help someone.

    The syntax of pscp is

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

    Target is the destination file and you are inputting a folder. Also, you are using a file syntax /home/pi and not a folder syntax /home/pi/ (note the / slash at the end). So you are asking pscp to overwrite your entire user folder and put the source file instead. Needless to say this could have result in a massive catastrophe, deleting your entire home folder.

    Your command should be:

    pspc myfile.txt pi@192.168.1.3:/home/pi/myfile.txt

    You can even hard code your password so that the transfer occurs without prompting.

    pspc -pw yourpassword myfile.txt pi@192.168.1.3:/home/pi/myfile.txt