Sneha Bansal
Sneha Bansal

Reputation: 941

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 [email protected]:/home/pi

pscp.exe -scp myfile.txt [email protected]:~/home/pi

pscp.exe -scp myfile.txt [email protected]:~/Desktop

pscp.exe -scp myfile.txt [email protected]:~

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

Upvotes: 1

Views: 3221

Answers (1)

Susensio
Susensio

Reputation: 860

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 [email protected]:/home/pi/myfile.txt

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

pspc -pw yourpassword myfile.txt [email protected]:/home/pi/myfile.txt

Upvotes: 2

Related Questions