This question already has an answer here:

I'm on a virtual machine trying to copy a file from SSH to local system. Using Debian. I don't see the "Connect to" option. When I try to do it trough terminal, I enter

scp [myusername@remote.system]:[path to the file obtained using "find"]

and it just gives me options for scp usage like -c etc If I enter the above command and add Downloads, it says file name and 100%, size etc, but the Downloads folder is empty What am I doing wrong? Please help!

marked as duplicate by Michael Homer, DarkHeart, thrig, jasonwryan, Gilles Apr 29 '17 at 11:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You missed out the destination. – Michael Homer Apr 28 '17 at 23:27
  • It's not working, please help me – Ekaterina Molostvova Apr 28 '17 at 23:33
  • it says permissions denied and i even changed them to 777 – Ekaterina Molostvova Apr 28 '17 at 23:33
  • Suggest giving the full command line you used and the error message too. Replace user@server.com with something clear that it has been changed. Without all the details we can only really guess as to what is wrong. – Tigger Apr 29 '17 at 4:27
  • Post the actual command you ran (copy-paste). Copy-paste the full error message(s) as well. – Gilles Apr 29 '17 at 11:31

I would suggest cding to the target directory and then doing the following:

  1. touch dummyfile - check if you have the permissions to create locally.
  2. Check you can SSH into the remote location and read the file you are trying to copy. Try ssh -vvv to debug connectivity and ssh key issues.
  3. scp user@remote . - the dot here is the current directory, so scp should then copy the file locally.

Hope you find this helpful.


Try this:

scp remoteuser@server:.bash_history newfile

Only need to change two things: name of remoteuser & name of server

If it works you should end up with a file on the local PC called newfile. There's a small chance that it doesn't work if you don't have .bash_history on the remote machine, but it's worth the gamble.

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