Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to transfer files from remote computer using ssh to my computer :

scp My_file.txt user_id@server:/Home

This should put My_file.txt in the home folder on my own computer, right? I get

scp/Home: permission denied

Also when I try: ...@server:/Desktop, in order to copy the files from the remote computer to my desktop.

What am I doing wrong?

share|improve this question
If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder. – Manula Waidyanatha Sep 12 '12 at 9:42
up vote 11 down vote accepted

Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:

scp My_file.txt user_id@server:/home/erez/

You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:

scp My_file.txt user_id@server:~/

You can even leave out the path altogether on the remote side; this means your home directory.

scp My_file.txt user_id@server:

That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:

scp My_file.txt user_id@server:/home/erez/Desktop/

or using the shortcut:

scp My_file.txt user_id@server:~/Desktop/

or using a relative path on the remote side, which is interpreted relative to your home directory:

scp My_file.txt user_id@server:Desktop/


As @ckhan already mentioned, you also have to swap the arguments, it has to be


So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:

scp user_id@server:/path/to/My_file.txt ~/Desktop/

If the file My_file.txt is located in your home directory on the server you may again use the shortcut:

scp user_id@server:~/My_file.txt ~/Desktop/
share|improve this answer
- I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot! – Erez Sep 12 '12 at 9:31
@Erez see my edit ;-) – binfalse Sep 12 '12 at 10:20
Works! THX both :-) – Erez Sep 12 '12 at 13:50
On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: \~ for example. – daniel Azuelos Mar 19 '15 at 12:21

You have the arguments to scp reversed. It's source first, then destination, like cp. man scp for more details.

share|improve this answer

I came here for "Transfer files using scp: permission denied" because I had the same error.

In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.

share|improve this answer
In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/ – Shadur Oct 9 '12 at 9:25

Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:

sudo scp -r /path2yourFolder/ username@server_Ip:/home/username

This will copy to your home directory on server.

This will also work:

scp -r /path2yourFolder/ username@server_Ip:~/
share|improve this answer

this seems to be like permissioning issue

The file might not have read permissions as it is delivered to the destination server as the source account.

you need to ensure the file at the source has required permissions especially read permission


chmod 744

then scp the file to destination. This will be resolved

share|improve this answer
-rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems. – G-Man Dec 10 '15 at 0:11

Install a windows tool "mRemoteG" from www.mremoteng.org/

Create your SSH connection to the desired box.

Click on the "Transfer File" menu.

It will allow to transfer file easily from Windows to Linux.


share|improve this answer

before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"

share|improve this answer
you can copy file that are not 777 – Archemar Mar 19 '15 at 10:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.