scp user@remote_host:remote_file local_file
where local_file might actually be a directory to put the file you're copying in. To upload, it's the opposite:scp local_file user@remote_host:remote_file
If you want to copy a whole directory, you will need -r
. Think of scp
as like cp
, except you can specify a file with user@remote_host:file
as well as just local files.Edit: As noted in a comment, if the usernames on the local and remote hosts are the same, then the user can be omitted when specifying a remote file.
Source: http://stackoverflow.com/questions/343711/transferring-files-over-ssh
No comments:
Post a Comment