# Transfer file from PC to Pi using, scp

**URL:** <https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000>\
**Category:** Uncategorized\
**Created:** [3 May 2023 05:20 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000 "2023-05-03T05:20:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan160034](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryan160034/32/8701_2.png) [@Bryan160034](https://forum.core-electronics.com.au/u/Bryan160034)\
**Post date:** [3 May 2023 05:20 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/1 "2023-05-03T05:20:00Z")

</div>

When trying to transfer a file from PC to Pi I get the following error.

Permission denied, please try again.

I have tried several times with the same result. As it asks for the pi password I would have thought it was going fine. The following is the command entered.

scp testcode.txt bryanpi@192.168.0.xxx:Desktop/

Is there something not set up correctly in ’ config’

Thank you. BC

---

<div class="post-metadata">

**Author:** ![Blayden](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/blayden/32/7535_2.png) [@Blayden](https://forum.core-electronics.com.au/u/Blayden)\
**Post date:** [3 May 2023 06:24 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/2 "2023-05-03T06:24:51Z")

</div>

Hey Bryan,  
Welcome to the forums!

It is possible that your remote machine does not have the permissions set up right to allow a remote transfer. Try and check if that machine has the permissions adjusted correctly.

The other thing that may be blocking it is your firewall, check the firewall settings to see if it is blocking SSH connection or file transfer.

Cheers,  
Blayden

---

<div class="post-metadata">

**Author:** ![Bryan160034](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryan160034/32/8701_2.png) [@Bryan160034](https://forum.core-electronics.com.au/u/Bryan160034)\
**Post date:** [3 May 2023 08:16 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/3 "2023-05-03T08:16:05Z")

</div>

Blayden, Thank you for your response. Fortunately I did have the items you suggested in place.  
I found an example online to send the file from the PC command line as below.

D:\temp\> scp testcode.txt [pi@192.168.0.107](mailto:pi@192.168.0.107):~/  
[pi@192.168.0.107](mailto:pi@192.168.0.107)’s password:  
testcode.txt

Thanks you your help.  
Bryan C

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [3 May 2023 23:23 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/4 "2023-05-03T23:23:21Z")

</div>

Is the following command valid? I’m unsure whether you can send directly to `192.168.0.xxx:Desktop/`

> [@Bryan160034](#):
>
> `scp testcode.txt bryanpi@192.168.0.xxx:Desktop/`

The problem may have been with the file path.

perhaps try using absolute file paths eg. `/home/pi/Desktop/testcode.txt`

---

<div class="post-metadata">

**Author:** ![Steven](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Steven](https://forum.core-electronics.com.au/u/Steven)\
**Post date:** [4 May 2023 00:38 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/5 "2023-05-04T00:38:20Z")

</div>

Without knowing your exact requirements but if you don’t need to use the CLI you can try a GUI app like Cyberduck or your PC to transfer your files over SFTP. I use it all the time, you just log in with the username on your Pi. No special software needed on the Pi. Cyberduck is free, but it will prompt you to donate, but that’s optional.

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [4 May 2023 01:32 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/6 "2023-05-04T01:32:16Z")

</div>

> [@Steven](#):
>
> if you don’t need to use the CLI you can try a GUI app

+1 👍  
Or set up a samba share and share a directory on your network

There’s definitely something satisfying about just sending it direct over CLI though 😛

---

<div class="post-metadata">

**Author:** ![Bryan160034](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryan160034/32/8701_2.png) [@Bryan160034](https://forum.core-electronics.com.au/u/Bryan160034)\
**Post date:** [4 May 2023 04:58 UTC](https://forum.core-electronics.com.au/t/transfer-file-from-pc-to-pi-using-scp/17000/7 "2023-05-04T04:58:03Z")

</div>

Hello Michael and Steven,

Using on the PC Windows PowerShell the following works successfully.

scp testcode2.py [pi@192.168.0.107](mailto:pi@192.168.0.107):

It seems we must use pi@… and not bryanpi@…

I have placed the files on an external drive d: it is so much easier than the main drive.

I find writing the initial code in Notepad on the PC and then transfer to Nano on the pi.

All good thank you for your interest and response.

Bryan C
