copying via ssh??

Oddysseey

Registered
hello everyone!

i was wondering how i could copy files from my local HD to a remote host via the terminal using ssh??

thanks for response,

oddy
 
You want scp for individual file copies, or sftp for an ftp-like interface for multiple copies and such.

Check the man pages for details, it's pretty straightforward
 
well, after connecting to the server via ssh, it says that i can't access my local home directory for copying files.... someone can help me?
thanks,

oddy
 
you don't need to ssh to the other host just do it from your machine like this

scp my/local/file.txt me@somewhere.com:where/it/goes/

The trick is that you add the user@host: bit to specify the remote directory. Also scp does multiple files just fine as well as recursive copies of directories. The only trick is that if you want to use a * in the remote name you have to put quotes around the whole thing like this

scp "bob@example.com:topsecret/*.html" ~/Documents

This will grab all the html files in Bob's top secret directory.

To recursively grab a directory use the -R switch and you are golden.
 
Back
Top