I'm looking to SCP a file on a remote host which I usually would SSH into. I have a config file setup when I SSH which saves alot of time and typing. I'm trying to do something similar for SCP in that I want to copy a remote file locally but don't want to have to type the IP/host etc. Is that possible?

Trying to get this to work with SCP -F but also need to sub-verse out of my home directory...

Here's where I'm at, where myserver is the name of the host specified in the SSH config file.

scp -v -F myserver://var/www/html/file01/sampledir/329/619/myfile.mp4 /Users/Tony/Desktop
  • Where is the question? Does it work? If not, where does it fail? Feb 4, 2014 at 14:28
  • Sorry, no it does not work - getting the below usage: scp [-1246BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2[code]
    – Tony
    Feb 4, 2014 at 14:30
  • 2
    Looks like you're feeding it an MP4 file as the ssh_config (-F)?? :) Feb 4, 2014 at 14:39
  • 1
    I have it working on my system, as follows: scp remotehost:/home/myname/myfile . And it works. Drop the -F option, and you are ok. Feb 4, 2014 at 14:43

1 Answer 1


Just save the config file as ~/.ssh/config, and it'll be used without the need for a -F flag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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